| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/customization/customization_document.h" | 5 #include "chrome/browser/chromeos/customization/customization_document.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 560 |
| 561 void ServicesCustomizationDocument::OnManifesteRead( | 561 void ServicesCustomizationDocument::OnManifesteRead( |
| 562 const std::string& manifest) { | 562 const std::string& manifest) { |
| 563 if (!manifest.empty()) | 563 if (!manifest.empty()) |
| 564 LoadManifestFromString(manifest); | 564 LoadManifestFromString(manifest); |
| 565 | 565 |
| 566 fetch_started_ = false; | 566 fetch_started_ = false; |
| 567 } | 567 } |
| 568 | 568 |
| 569 void ServicesCustomizationDocument::StartFileFetch() { | 569 void ServicesCustomizationDocument::StartFileFetch() { |
| 570 DelayNetworkCall(base::Bind(&ServicesCustomizationDocument::DoStartFileFetch, | 570 DelayNetworkCall(network_delay_, |
| 571 weak_ptr_factory_.GetWeakPtr()), | 571 base::Bind(&ServicesCustomizationDocument::DoStartFileFetch, |
| 572 network_delay_); | 572 weak_ptr_factory_.GetWeakPtr())); |
| 573 } | 573 } |
| 574 | 574 |
| 575 void ServicesCustomizationDocument::DoStartFileFetch() { | 575 void ServicesCustomizationDocument::DoStartFileFetch() { |
| 576 url_fetcher_.reset(net::URLFetcher::Create( | 576 url_fetcher_.reset(net::URLFetcher::Create( |
| 577 url_, net::URLFetcher::GET, this)); | 577 url_, net::URLFetcher::GET, this)); |
| 578 url_fetcher_->SetRequestContext(g_browser_process->system_request_context()); | 578 url_fetcher_->SetRequestContext(g_browser_process->system_request_context()); |
| 579 url_fetcher_->AddExtraRequestHeader("Accept: application/json"); | 579 url_fetcher_->AddExtraRequestHeader("Accept: application/json"); |
| 580 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 580 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | |
| 581 net::LOAD_DO_NOT_SAVE_COOKIES | | 581 net::LOAD_DO_NOT_SAVE_COOKIES | |
| 582 net::LOAD_DISABLE_CACHE | | 582 net::LOAD_DISABLE_CACHE | |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 apply_tasks_success_ += success; | 963 apply_tasks_success_ += success; |
| 964 | 964 |
| 965 if (apply_tasks_started_ != apply_tasks_finished_) | 965 if (apply_tasks_started_ != apply_tasks_finished_) |
| 966 return; | 966 return; |
| 967 | 967 |
| 968 if (apply_tasks_success_ == apply_tasks_finished_) | 968 if (apply_tasks_success_ == apply_tasks_finished_) |
| 969 SetApplied(true); | 969 SetApplied(true); |
| 970 } | 970 } |
| 971 | 971 |
| 972 } // namespace chromeos | 972 } // namespace chromeos |
| OLD | NEW |