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

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

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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
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/profile_writer.h" 5 #include "chrome/browser/importer/profile_writer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 FaviconServiceFactory::GetForProfile(profile_, 252 FaviconServiceFactory::GetForProfile(profile_,
253 ServiceAccessType::EXPLICIT_ACCESS) 253 ServiceAccessType::EXPLICIT_ACCESS)
254 ->SetImportedFavicons(favicons); 254 ->SetImportedFavicons(favicons);
255 } 255 }
256 256
257 typedef std::map<std::string, TemplateURL*> HostPathMap; 257 typedef std::map<std::string, TemplateURL*> HostPathMap;
258 258
259 // Returns the key for the map built by BuildHostPathMap. If url_string is not 259 // Returns the key for the map built by BuildHostPathMap. If url_string is not
260 // a valid URL, an empty string is returned, otherwise host+path is returned. 260 // a valid URL, an empty string is returned, otherwise host+path is returned.
261 static std::string HostPathKeyForURL(const GURL& url) { 261 static std::string HostPathKeyForURL(const GURL& url) {
262 return url.is_valid() ? url.host() + url.path() : std::string(); 262 return url.is_valid() ? url.host() + url.path().as_string() : std::string();
263 } 263 }
264 264
265 // Builds the key to use in HostPathMap for the specified TemplateURL. Returns 265 // Builds the key to use in HostPathMap for the specified TemplateURL. Returns
266 // an empty string if a host+path can't be generated for the TemplateURL. 266 // an empty string if a host+path can't be generated for the TemplateURL.
267 // If an empty string is returned, the TemplateURL should not be added to 267 // If an empty string is returned, the TemplateURL should not be added to
268 // HostPathMap. 268 // HostPathMap.
269 // 269 //
270 // If |try_url_if_invalid| is true, and |t_url| isn't valid, a string is built 270 // If |try_url_if_invalid| is true, and |t_url| isn't valid, a string is built
271 // from the raw TemplateURL string. Use a value of true for |try_url_if_invalid| 271 // from the raw TemplateURL string. Use a value of true for |try_url_if_invalid|
272 // when checking imported URLs as the imported URL may not be valid yet may 272 // when checking imported URLs as the imported URL may not be valid yet may
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 void ProfileWriter::AddAutofillFormDataEntries( 349 void ProfileWriter::AddAutofillFormDataEntries(
350 const std::vector<autofill::AutofillEntry>& autofill_entries) { 350 const std::vector<autofill::AutofillEntry>& autofill_entries) {
351 scoped_refptr<autofill::AutofillWebDataService> web_data_service = 351 scoped_refptr<autofill::AutofillWebDataService> web_data_service =
352 WebDataServiceFactory::GetAutofillWebDataForProfile( 352 WebDataServiceFactory::GetAutofillWebDataForProfile(
353 profile_, ServiceAccessType::EXPLICIT_ACCESS); 353 profile_, ServiceAccessType::EXPLICIT_ACCESS);
354 if (web_data_service.get()) 354 if (web_data_service.get())
355 web_data_service->UpdateAutofillEntries(autofill_entries); 355 web_data_service->UpdateAutofillEntries(autofill_entries);
356 } 356 }
357 357
358 ProfileWriter::~ProfileWriter() {} 358 ProfileWriter::~ProfileWriter() {}
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_inline_installer.cc ('k') | chrome/browser/password_manager/password_store_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698