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/chrome_content_client.h" | 17 #include "chrome/common/chrome_content_client.h" |
17 #include "chrome/common/chrome_version_info.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 "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
25 #include "extensions/browser/extension_registry.h" | 26 #include "extensions/browser/extension_registry.h" |
26 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
27 | 28 |
28 using feedback::FeedbackData; | 29 using feedback::FeedbackData; |
29 | 30 |
30 namespace { | 31 namespace { |
31 | 32 |
32 // Feedback bucket labels. | 33 // Feedback bucket labels. |
33 const char kProfileResetPromptBucket[] = "SamplingOfSettingsResetPrompt"; | 34 const char kProfileResetPromptBucket[] = "SamplingOfSettingsResetPrompt"; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 const ResettableSettingsSnapshot& snapshot) { | 250 const ResettableSettingsSnapshot& snapshot) { |
250 DCHECK(profile); | 251 DCHECK(profile); |
251 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 252 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
252 scoped_ptr<base::ListValue> list(new base::ListValue); | 253 scoped_ptr<base::ListValue> list(new base::ListValue); |
253 AddPair(list.get(), | 254 AddPair(list.get(), |
254 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_LOCALE), | 255 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_LOCALE), |
255 g_browser_process->GetApplicationLocale()); | 256 g_browser_process->GetApplicationLocale()); |
256 AddPair(list.get(), | 257 AddPair(list.get(), |
257 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_USER_AGENT), | 258 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_USER_AGENT), |
258 GetUserAgent()); | 259 GetUserAgent()); |
259 chrome::VersionInfo version_info; | 260 std::string version = version_info::GetVersionNumber(); |
260 std::string version = version_info.Version(); | 261 version += chrome::GetChannelString(); |
261 version += chrome::VersionInfo::GetVersionStringModifier(); | |
262 AddPair(list.get(), | 262 AddPair(list.get(), |
263 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 263 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
264 version); | 264 version); |
265 | 265 |
266 // Add snapshot data. | 266 // Add snapshot data. |
267 const std::vector<GURL>& urls = snapshot.startup_urls(); | 267 const std::vector<GURL>& urls = snapshot.startup_urls(); |
268 std::string startup_urls; | 268 std::string startup_urls; |
269 for (std::vector<GURL>::const_iterator i = urls.begin(); | 269 for (std::vector<GURL>::const_iterator i = urls.begin(); |
270 i != urls.end(); ++i) { | 270 i != urls.end(); ++i) { |
271 if (!startup_urls.empty()) | 271 if (!startup_urls.empty()) |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 extension_names += '\n'; | 359 extension_names += '\n'; |
360 extension_names += i->second; | 360 extension_names += i->second; |
361 } | 361 } |
362 if (!extension_names.empty()) { | 362 if (!extension_names.empty()) { |
363 AddPair(list.get(), | 363 AddPair(list.get(), |
364 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), | 364 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), |
365 extension_names); | 365 extension_names); |
366 } | 366 } |
367 return list.Pass(); | 367 return list.Pass(); |
368 } | 368 } |
OLD | NEW |