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

Side by Side Diff: chrome/browser/importer/toolbar_importer.cc

Issue 10412050: Change most content::URLFetcher references to net::URLFetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromeOS, address comments 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/importer/toolbar_importer.h" 5 #include "chrome/browser/importer/toolbar_importer.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 // Retrieve authorization token from the network. 207 // Retrieve authorization token from the network.
208 std::string url_string(kT5AuthorizationTokenUrl); 208 std::string url_string(kT5AuthorizationTokenUrl);
209 url_string.replace(url_string.find(kRandomNumberToken), 209 url_string.replace(url_string.find(kRandomNumberToken),
210 arraysize(kRandomNumberToken) - 1, 210 arraysize(kRandomNumberToken) - 1,
211 random_string); 211 random_string);
212 GURL url(url_string); 212 GURL url(url_string);
213 213
214 // Because the importer is started as the result of a user action which 214 // Because the importer is started as the result of a user action which
215 // explicitly requires authentication, sending cookies here is reasonable. 215 // explicitly requires authentication, sending cookies here is reasonable.
216 token_fetcher_ = content::URLFetcher::Create( 216 token_fetcher_ = content::URLFetcher::Create(
217 url, content::URLFetcher::GET, this); 217 url, net::URLFetcher::GET, this);
218 token_fetcher_->SetRequestContext(request_context_getter_.get()); 218 token_fetcher_->SetRequestContext(request_context_getter_.get());
219 token_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); 219 token_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
220 token_fetcher_->Start(); 220 token_fetcher_->Start();
221 } 221 }
222 222
223 void Toolbar5Importer::GetBookmarkDataFromServer(const std::string& response) { 223 void Toolbar5Importer::GetBookmarkDataFromServer(const std::string& response) {
224 if (cancelled()) { 224 if (cancelled()) {
225 EndImport(); 225 EndImport();
226 return; 226 return;
227 } 227 }
(...skipping 16 matching lines...) Expand all
244 arraysize(kRandomNumberToken) - 1, 244 arraysize(kRandomNumberToken) - 1,
245 random_string); 245 random_string);
246 conn_string.replace(conn_string.find(kAuthorizationToken), 246 conn_string.replace(conn_string.find(kAuthorizationToken),
247 arraysize(kAuthorizationToken) - 1, 247 arraysize(kAuthorizationToken) - 1,
248 token); 248 token);
249 GURL url(conn_string); 249 GURL url(conn_string);
250 250
251 // Because the importer is started as the result of a user action which 251 // Because the importer is started as the result of a user action which
252 // explicitly requires authentication, sending cookies here is reasonable. 252 // explicitly requires authentication, sending cookies here is reasonable.
253 data_fetcher_ = content::URLFetcher::Create( 253 data_fetcher_ = content::URLFetcher::Create(
254 url, content::URLFetcher::GET, this); 254 url, net::URLFetcher::GET, this);
255 data_fetcher_->SetRequestContext(request_context_getter_.get()); 255 data_fetcher_->SetRequestContext(request_context_getter_.get());
256 data_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); 256 data_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
257 data_fetcher_->Start(); 257 data_fetcher_->Start();
258 } 258 }
259 259
260 void Toolbar5Importer::GetBookmarksFromServerDataResponse( 260 void Toolbar5Importer::GetBookmarksFromServerDataResponse(
261 const std::string& response) { 261 const std::string& response) {
262 if (cancelled()) { 262 if (cancelled()) {
263 EndImport(); 263 EndImport();
264 return; 264 return;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 } 563 }
564 564
565 void Toolbar5Importer::AddBookmarksToChrome( 565 void Toolbar5Importer::AddBookmarksToChrome(
566 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks) { 566 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks) {
567 if (!bookmarks.empty() && !cancelled()) { 567 if (!bookmarks.empty() && !cancelled()) {
568 const string16& first_folder_name = 568 const string16& first_folder_name =
569 bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_GOOGLE_TOOLBAR); 569 bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_GOOGLE_TOOLBAR);
570 bridge_->AddBookmarks(bookmarks, first_folder_name); 570 bridge_->AddBookmarks(bookmarks, first_folder_name);
571 } 571 }
572 } 572 }
OLDNEW
« no previous file with comments | « chrome/browser/google/google_url_tracker.cc ('k') | chrome/browser/intents/cws_intents_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698