| 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 | 556 |
| 557 void ServicesCustomizationDocument::OnManifesteRead( | 557 void ServicesCustomizationDocument::OnManifesteRead( |
| 558 const std::string& manifest) { | 558 const std::string& manifest) { |
| 559 if (!manifest.empty()) | 559 if (!manifest.empty()) |
| 560 LoadManifestFromString(manifest); | 560 LoadManifestFromString(manifest); |
| 561 | 561 |
| 562 fetch_started_ = false; | 562 fetch_started_ = false; |
| 563 } | 563 } |
| 564 | 564 |
| 565 void ServicesCustomizationDocument::StartFileFetch() { | 565 void ServicesCustomizationDocument::StartFileFetch() { |
| 566 DelayNetworkCall(base::Bind(&ServicesCustomizationDocument::DoStartFileFetch, | 566 DelayNetworkCall(network_delay_, |
| 567 weak_ptr_factory_.GetWeakPtr()), | 567 base::Bind(&ServicesCustomizationDocument::DoStartFileFetch, |
| 568 network_delay_); | 568 weak_ptr_factory_.GetWeakPtr())); |
| 569 } | 569 } |
| 570 | 570 |
| 571 void ServicesCustomizationDocument::DoStartFileFetch() { | 571 void ServicesCustomizationDocument::DoStartFileFetch() { |
| 572 url_fetcher_.reset(net::URLFetcher::Create( | 572 url_fetcher_.reset(net::URLFetcher::Create( |
| 573 url_, net::URLFetcher::GET, this)); | 573 url_, net::URLFetcher::GET, this)); |
| 574 url_fetcher_->SetRequestContext(g_browser_process->system_request_context()); | 574 url_fetcher_->SetRequestContext(g_browser_process->system_request_context()); |
| 575 url_fetcher_->AddExtraRequestHeader("Accept: application/json"); | 575 url_fetcher_->AddExtraRequestHeader("Accept: application/json"); |
| 576 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 576 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | |
| 577 net::LOAD_DO_NOT_SAVE_COOKIES | | 577 net::LOAD_DO_NOT_SAVE_COOKIES | |
| 578 net::LOAD_DISABLE_CACHE | | 578 net::LOAD_DISABLE_CACHE | |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 apply_tasks_success_ += success; | 957 apply_tasks_success_ += success; |
| 958 | 958 |
| 959 if (apply_tasks_started_ != apply_tasks_finished_) | 959 if (apply_tasks_started_ != apply_tasks_finished_) |
| 960 return; | 960 return; |
| 961 | 961 |
| 962 if (apply_tasks_success_ == apply_tasks_finished_) | 962 if (apply_tasks_success_ == apply_tasks_finished_) |
| 963 SetApplied(true); | 963 SetApplied(true); |
| 964 } | 964 } |
| 965 | 965 |
| 966 } // namespace chromeos | 966 } // namespace chromeos |
| OLD | NEW |