| 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" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/feedback/feedback_data.h" | 14 #include "chrome/browser/feedback/feedback_data.h" |
| 15 #include "chrome/browser/feedback/feedback_util.h" | 15 #include "chrome/browser/feedback/feedback_util.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/search_engines/template_url_service.h" | 17 #include "chrome/browser/search_engines/template_url_service.h" |
| 18 #include "chrome/browser/search_engines/template_url_service_factory.h" | 18 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 19 #include "chrome/common/chrome_content_client.h" | |
| 20 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
| 21 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 22 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 23 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 24 #include "grit/google_chrome_strings.h" | 23 #include "grit/google_chrome_strings.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 26 | 25 |
| 27 namespace { | 26 namespace { |
| 28 | 27 |
| 29 // Feedback bucket labels. | 28 // Feedback bucket labels. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 Profile* profile, | 241 Profile* profile, |
| 243 const ResettableSettingsSnapshot& snapshot) { | 242 const ResettableSettingsSnapshot& snapshot) { |
| 244 DCHECK(profile); | 243 DCHECK(profile); |
| 245 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 244 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 246 scoped_ptr<base::ListValue> list(new base::ListValue); | 245 scoped_ptr<base::ListValue> list(new base::ListValue); |
| 247 AddPair(list.get(), | 246 AddPair(list.get(), |
| 248 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_LOCALE), | 247 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_LOCALE), |
| 249 g_browser_process->GetApplicationLocale()); | 248 g_browser_process->GetApplicationLocale()); |
| 250 AddPair(list.get(), | 249 AddPair(list.get(), |
| 251 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_USER_AGENT), | 250 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_USER_AGENT), |
| 252 GetUserAgent()); | 251 content::GetUserAgent(GURL())); |
| 253 chrome::VersionInfo version_info; | 252 chrome::VersionInfo version_info; |
| 254 std::string version = version_info.Version(); | 253 std::string version = version_info.Version(); |
| 255 version += chrome::VersionInfo::GetVersionStringModifier(); | 254 version += chrome::VersionInfo::GetVersionStringModifier(); |
| 256 AddPair(list.get(), | 255 AddPair(list.get(), |
| 257 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 256 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| 258 version); | 257 version); |
| 259 | 258 |
| 260 // Add snapshot data. | 259 // Add snapshot data. |
| 261 const std::vector<GURL>& urls = snapshot.startup_urls(); | 260 const std::vector<GURL>& urls = snapshot.startup_urls(); |
| 262 std::string startup_urls; | 261 std::string startup_urls; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 extension_names += '\n'; | 344 extension_names += '\n'; |
| 346 extension_names += i->second; | 345 extension_names += i->second; |
| 347 } | 346 } |
| 348 if (!extension_names.empty()) { | 347 if (!extension_names.empty()) { |
| 349 AddPair(list.get(), | 348 AddPair(list.get(), |
| 350 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), | 349 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), |
| 351 extension_names); | 350 extension_names); |
| 352 } | 351 } |
| 353 return list.Pass(); | 352 return list.Pass(); |
| 354 } | 353 } |
| OLD | NEW |