| 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/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "base/synchronization/cancellation_flag.h" | 11 #include "base/synchronization/cancellation_flag.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/search_engines/template_url_service_factory.h" | 15 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 16 #include "chrome/common/channel_info.h" | 16 #include "chrome/common/channel_info.h" |
| 17 #include "chrome/common/chrome_content_client.h" | 17 #include "chrome/common/chrome_content_client.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/grit/chromium_strings.h" | 19 #include "chrome/grit/chromium_strings.h" |
| 20 #include "chrome/grit/generated_resources.h" | 20 #include "chrome/grit/generated_resources.h" |
| 21 #include "components/feedback/feedback_data.h" | 21 #include "components/feedback/feedback_data.h" |
| 22 #include "components/feedback/feedback_util.h" | 22 #include "components/feedback/feedback_util.h" |
| 23 #include "components/search_engines/template_url_service.h" | 23 #include "components/search_engines/template_url_service.h" |
| 24 #include "components/version_info/version_info.h" | 24 #include "components/version_info/version_info.h" |
| 25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 26 #include "extensions/browser/extension_registry.h" | 26 #include "extensions/browser/extension_registry.h" |
| 27 #include "grit/components_strings.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
| 28 | 29 |
| 29 using feedback::FeedbackData; | 30 using feedback::FeedbackData; |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 // Feedback bucket labels. | 34 // Feedback bucket labels. |
| 34 const char kProfileResetPromptBucket[] = "SamplingOfSettingsResetPrompt"; | 35 const char kProfileResetPromptBucket[] = "SamplingOfSettingsResetPrompt"; |
| 35 const char kProfileResetWebUIBucket[] = "ProfileResetReport"; | 36 const char kProfileResetWebUIBucket[] = "ProfileResetReport"; |
| 36 | 37 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 scoped_ptr<base::ListValue> GetReadableFeedbackForSnapshot( | 249 scoped_ptr<base::ListValue> GetReadableFeedbackForSnapshot( |
| 249 Profile* profile, | 250 Profile* profile, |
| 250 const ResettableSettingsSnapshot& snapshot) { | 251 const ResettableSettingsSnapshot& snapshot) { |
| 251 DCHECK(profile); | 252 DCHECK(profile); |
| 252 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 253 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 253 scoped_ptr<base::ListValue> list(new base::ListValue); | 254 scoped_ptr<base::ListValue> list(new base::ListValue); |
| 254 AddPair(list.get(), | 255 AddPair(list.get(), |
| 255 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_LOCALE), | 256 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_LOCALE), |
| 256 g_browser_process->GetApplicationLocale()); | 257 g_browser_process->GetApplicationLocale()); |
| 257 AddPair(list.get(), | 258 AddPair(list.get(), |
| 258 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_USER_AGENT), | 259 l10n_util::GetStringUTF16(IDS_VERSION_UI_USER_AGENT), |
| 259 GetUserAgent()); | 260 GetUserAgent()); |
| 260 std::string version = version_info::GetVersionNumber(); | 261 std::string version = version_info::GetVersionNumber(); |
| 261 version += chrome::GetChannelString(); | 262 version += chrome::GetChannelString(); |
| 262 AddPair(list.get(), | 263 AddPair(list.get(), |
| 263 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 264 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| 264 version); | 265 version); |
| 265 | 266 |
| 266 // Add snapshot data. | 267 // Add snapshot data. |
| 267 const std::vector<GURL>& urls = snapshot.startup_urls(); | 268 const std::vector<GURL>& urls = snapshot.startup_urls(); |
| 268 std::string startup_urls; | 269 std::string startup_urls; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 extension_names += '\n'; | 360 extension_names += '\n'; |
| 360 extension_names += i->second; | 361 extension_names += i->second; |
| 361 } | 362 } |
| 362 if (!extension_names.empty()) { | 363 if (!extension_names.empty()) { |
| 363 AddPair(list.get(), | 364 AddPair(list.get(), |
| 364 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), | 365 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), |
| 365 extension_names); | 366 extension_names); |
| 366 } | 367 } |
| 367 return list.Pass(); | 368 return list.Pass(); |
| 368 } | 369 } |
| OLD | NEW |