| OLD | NEW |
| 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 Loading... |
| 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( | 316 dse->GenerateSearchURL(service->search_terms_data()).host()); |
| 317 dse, service->search_terms_data()).host()); | |
| 318 } | 317 } |
| 319 | 318 |
| 320 if (snapshot.shortcuts_determined()) { | 319 if (snapshot.shortcuts_determined()) { |
| 321 base::string16 shortcut_targets; | 320 base::string16 shortcut_targets; |
| 322 const std::vector<ShortcutCommand>& shortcuts = snapshot.shortcuts(); | 321 const std::vector<ShortcutCommand>& shortcuts = snapshot.shortcuts(); |
| 323 for (std::vector<ShortcutCommand>::const_iterator i = | 322 for (std::vector<ShortcutCommand>::const_iterator i = |
| 324 shortcuts.begin(); i != shortcuts.end(); ++i) { | 323 shortcuts.begin(); i != shortcuts.end(); ++i) { |
| 325 if (!shortcut_targets.empty()) | 324 if (!shortcut_targets.empty()) |
| 326 shortcut_targets += base::ASCIIToUTF16("\n"); | 325 shortcut_targets += base::ASCIIToUTF16("\n"); |
| 327 shortcut_targets += base::ASCIIToUTF16("chrome.exe "); | 326 shortcut_targets += base::ASCIIToUTF16("chrome.exe "); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 348 extension_names += '\n'; | 347 extension_names += '\n'; |
| 349 extension_names += i->second; | 348 extension_names += i->second; |
| 350 } | 349 } |
| 351 if (!extension_names.empty()) { | 350 if (!extension_names.empty()) { |
| 352 AddPair(list.get(), | 351 AddPair(list.get(), |
| 353 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), | 352 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), |
| 354 extension_names); | 353 extension_names); |
| 355 } | 354 } |
| 356 return list.Pass(); | 355 return list.Pass(); |
| 357 } | 356 } |
| OLD | NEW |