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