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

Side by Side Diff: chrome/browser/profile_resetter/resettable_settings_snapshot.cc

Issue 338363004: Remove Profile* from TemplateURL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/profile_resetter/resettable_settings_snapshot.h" 5 #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/synchronization/cancellation_flag.h" 10 #include "base/synchronization/cancellation_flag.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_HOMEPAGE_IS_NTP), 306 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_HOMEPAGE_IS_NTP),
307 l10n_util::GetStringUTF16(is_ntp_message_id)); 307 l10n_util::GetStringUTF16(is_ntp_message_id));
308 308
309 TemplateURLService* service = 309 TemplateURLService* service =
310 TemplateURLServiceFactory::GetForProfile(profile); 310 TemplateURLServiceFactory::GetForProfile(profile);
311 DCHECK(service); 311 DCHECK(service);
312 TemplateURL* dse = service->GetDefaultSearchProvider(); 312 TemplateURL* dse = service->GetDefaultSearchProvider();
313 if (dse) { 313 if (dse) {
314 AddPair(list.get(), 314 AddPair(list.get(),
315 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_DSE), 315 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_DSE),
316 TemplateURLService::GenerateSearchURL(dse).host()); 316 TemplateURLService::GenerateSearchURL(
317 dse, service->search_terms_data()).host());
317 } 318 }
318 319
319 if (snapshot.shortcuts_determined()) { 320 if (snapshot.shortcuts_determined()) {
320 base::string16 shortcut_targets; 321 base::string16 shortcut_targets;
321 const std::vector<ShortcutCommand>& shortcuts = snapshot.shortcuts(); 322 const std::vector<ShortcutCommand>& shortcuts = snapshot.shortcuts();
322 for (std::vector<ShortcutCommand>::const_iterator i = 323 for (std::vector<ShortcutCommand>::const_iterator i =
323 shortcuts.begin(); i != shortcuts.end(); ++i) { 324 shortcuts.begin(); i != shortcuts.end(); ++i) {
324 if (!shortcut_targets.empty()) 325 if (!shortcut_targets.empty())
325 shortcut_targets += base::ASCIIToUTF16("\n"); 326 shortcut_targets += base::ASCIIToUTF16("\n");
326 shortcut_targets += base::ASCIIToUTF16("chrome.exe "); 327 shortcut_targets += base::ASCIIToUTF16("chrome.exe ");
(...skipping 20 matching lines...) Expand all
347 extension_names += '\n'; 348 extension_names += '\n';
348 extension_names += i->second; 349 extension_names += i->second;
349 } 350 }
350 if (!extension_names.empty()) { 351 if (!extension_names.empty()) {
351 AddPair(list.get(), 352 AddPair(list.get(),
352 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), 353 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS),
353 extension_names); 354 extension_names);
354 } 355 }
355 return list.Pass(); 356 return list.Pass();
356 } 357 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698