Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Side by Side Diff: chrome/browser/chromeos/customization_document.cc

Issue 10386063: Move URLFetcherDelegate to net/ and split URLFetcher between net/ and content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to head, fix win component build Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_document.h" 5 #include "chrome/browser/chromeos/customization_document.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 void ServicesCustomizationDocument::StartFileFetch() { 296 void ServicesCustomizationDocument::StartFileFetch() {
297 DCHECK(url_.is_valid()); 297 DCHECK(url_.is_valid());
298 url_fetcher_.reset(content::URLFetcher::Create( 298 url_fetcher_.reset(content::URLFetcher::Create(
299 url_, content::URLFetcher::GET, this)); 299 url_, content::URLFetcher::GET, this));
300 url_fetcher_->SetRequestContext( 300 url_fetcher_->SetRequestContext(
301 ProfileManager::GetDefaultProfile()->GetRequestContext()); 301 ProfileManager::GetDefaultProfile()->GetRequestContext());
302 url_fetcher_->Start(); 302 url_fetcher_->Start();
303 } 303 }
304 304
305 void ServicesCustomizationDocument::OnURLFetchComplete( 305 void ServicesCustomizationDocument::OnURLFetchComplete(
306 const content::URLFetcher* source) { 306 const net::URLFetcher* source) {
307 if (source->GetResponseCode() == 200) { 307 if (source->GetResponseCode() == 200) {
308 std::string data; 308 std::string data;
309 source->GetResponseAsString(&data); 309 source->GetResponseAsString(&data);
310 LoadManifestFromString(data); 310 LoadManifestFromString(data);
311 } else { 311 } else {
312 NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary(); 312 NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary();
313 if (!network->Connected() && num_retries_ < kMaxFetchRetries) { 313 if (!network->Connected() && num_retries_ < kMaxFetchRetries) {
314 num_retries_++; 314 num_retries_++;
315 retry_timer_.Start(FROM_HERE, 315 retry_timer_.Start(FROM_HERE,
316 base::TimeDelta::FromSeconds(kRetriesDelayInSec), 316 base::TimeDelta::FromSeconds(kRetriesDelayInSec),
(...skipping 18 matching lines...) Expand all
335 locale, kAppContentAttr, kInitialStartPageAttr); 335 locale, kAppContentAttr, kInitialStartPageAttr);
336 } 336 }
337 337
338 std::string ServicesCustomizationDocument::GetSupportPage( 338 std::string ServicesCustomizationDocument::GetSupportPage(
339 const std::string& locale) const { 339 const std::string& locale) const {
340 return GetLocaleSpecificString( 340 return GetLocaleSpecificString(
341 locale, kAppContentAttr, kSupportPageAttr); 341 locale, kAppContentAttr, kSupportPageAttr);
342 } 342 }
343 343
344 } // namespace chromeos 344 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/customization_document.h ('k') | chrome/browser/chromeos/gdata/gdata_operations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698