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

Side by Side Diff: chrome/browser/ui/webui/help/help_handler.cc

Issue 12490012: Send Feedback Experiment (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: removed duplicate constant strings Created 7 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/help/help_handler.h" 5 #include "chrome/browser/ui/webui/help/help_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/string16.h" 13 #include "base/string16.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/google/google_util.h" 17 #include "chrome/browser/google/google_util.h"
18 #include "chrome/browser/policy/browser_policy_connector.h" 18 #include "chrome/browser/policy/browser_policy_connector.h"
19 #include "chrome/browser/ui/browser.h" 19 #include "chrome/browser/ui/browser.h"
20 #include "chrome/browser/ui/browser_commands.h" 20 #include "chrome/browser/ui/browser_commands.h"
21 #include "chrome/browser/ui/browser_finder.h" 21 #include "chrome/browser/ui/browser_finder.h"
22 #include "chrome/browser/ui/chrome_pages.h" 22 #include "chrome/browser/ui/chrome_pages.h"
23 #include "chrome/browser/ui/send_feedback_experiment.h"
23 #include "chrome/common/chrome_notification_types.h" 24 #include "chrome/common/chrome_notification_types.h"
24 #include "chrome/common/chrome_version_info.h" 25 #include "chrome/common/chrome_version_info.h"
25 #include "chrome/common/url_constants.h" 26 #include "chrome/common/url_constants.h"
26 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
27 #include "content/public/browser/notification_service.h" 28 #include "content/public/browser/notification_service.h"
28 #include "content/public/browser/web_ui.h" 29 #include "content/public/browser/web_ui.h"
29 #include "content/public/browser/web_ui_data_source.h" 30 #include "content/public/browser/web_ui_data_source.h"
30 #include "content/public/common/content_client.h" 31 #include "content/public/common/content_client.h"
31 #include "grit/chromium_strings.h" 32 #include "grit/chromium_strings.h"
32 #include "grit/generated_resources.h" 33 #include "grit/generated_resources.h"
(...skipping 13 matching lines...) Expand all
46 #include "chrome/browser/chromeos/settings/cros_settings.h" 47 #include "chrome/browser/chromeos/settings/cros_settings.h"
47 #include "chrome/browser/profiles/profile.h" 48 #include "chrome/browser/profiles/profile.h"
48 #include "content/public/browser/browser_thread.h" 49 #include "content/public/browser/browser_thread.h"
49 #endif 50 #endif
50 51
51 using base::ListValue; 52 using base::ListValue;
52 using content::BrowserThread; 53 using content::BrowserThread;
53 54
54 namespace { 55 namespace {
55 56
57 const std::string kResourceReportIssue = "reportAnIssue";
SteveT 2013/03/21 05:04:39 nit: Line break here to separate variables from fu
sky 2013/03/21 15:02:50 We don't use strings here as it results in a stati
Harry McCleave 2013/03/21 20:42:09 Done.
56 // Returns the browser version as a string. 58 // Returns the browser version as a string.
57 string16 BuildBrowserVersionString() { 59 string16 BuildBrowserVersionString() {
58 chrome::VersionInfo version_info; 60 chrome::VersionInfo version_info;
59 DCHECK(version_info.is_valid()); 61 DCHECK(version_info.is_valid());
60 62
61 std::string browser_version = version_info.Version(); 63 std::string browser_version = version_info.Version();
62 std::string version_modifier = 64 std::string version_modifier =
63 chrome::VersionInfo::GetVersionStringModifier(); 65 chrome::VersionInfo::GetVersionStringModifier();
64 if (!version_modifier.empty()) 66 if (!version_modifier.empty())
65 browser_version += " " + version_modifier; 67 browser_version += " " + version_modifier;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 #endif 134 #endif
133 { "aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION }, 135 { "aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION },
134 { "relaunch", IDS_RELAUNCH_BUTTON }, 136 { "relaunch", IDS_RELAUNCH_BUTTON },
135 { "productName", IDS_PRODUCT_NAME }, 137 { "productName", IDS_PRODUCT_NAME },
136 { "productCopyright", IDS_ABOUT_VERSION_COPYRIGHT }, 138 { "productCopyright", IDS_ABOUT_VERSION_COPYRIGHT },
137 { "updateCheckStarted", IDS_UPGRADE_CHECK_STARTED }, 139 { "updateCheckStarted", IDS_UPGRADE_CHECK_STARTED },
138 { "upToDate", IDS_UPGRADE_UP_TO_DATE }, 140 { "upToDate", IDS_UPGRADE_UP_TO_DATE },
139 { "updating", IDS_UPGRADE_UPDATING }, 141 { "updating", IDS_UPGRADE_UPDATING },
140 { "updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH }, 142 { "updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH },
141 { "getHelpWithChrome", IDS_GET_HELP_USING_CHROME }, 143 { "getHelpWithChrome", IDS_GET_HELP_USING_CHROME },
142 { "reportAnIssue", IDS_REPORT_AN_ISSUE }, 144 { kResourceReportIssue.c_str(), IDS_REPORT_AN_ISSUE },
143 #if defined(OS_CHROMEOS) 145 #if defined(OS_CHROMEOS)
144 { "platform", IDS_PLATFORM_LABEL }, 146 { "platform", IDS_PLATFORM_LABEL },
145 { "firmware", IDS_ABOUT_PAGE_FIRMWARE }, 147 { "firmware", IDS_ABOUT_PAGE_FIRMWARE },
146 { "showMoreInfo", IDS_SHOW_MORE_INFO }, 148 { "showMoreInfo", IDS_SHOW_MORE_INFO },
147 { "hideMoreInfo", IDS_HIDE_MORE_INFO }, 149 { "hideMoreInfo", IDS_HIDE_MORE_INFO },
148 { "channel", IDS_ABOUT_PAGE_CHANNEL }, 150 { "channel", IDS_ABOUT_PAGE_CHANNEL },
149 { "stable", IDS_ABOUT_PAGE_CHANNEL_STABLE }, 151 { "stable", IDS_ABOUT_PAGE_CHANNEL_STABLE },
150 { "beta", IDS_ABOUT_PAGE_CHANNEL_BETA }, 152 { "beta", IDS_ABOUT_PAGE_CHANNEL_BETA },
151 { "dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT }, 153 { "dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT },
152 { "channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED }, 154 { "channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED },
153 { "webkit", IDS_WEBKIT }, 155 { "webkit", IDS_WEBKIT },
154 { "userAgent", IDS_ABOUT_VERSION_USER_AGENT }, 156 { "userAgent", IDS_ABOUT_VERSION_USER_AGENT },
155 { "commandLine", IDS_ABOUT_VERSION_COMMAND_LINE }, 157 { "commandLine", IDS_ABOUT_VERSION_COMMAND_LINE },
156 { "buildDate", IDS_ABOUT_VERSION_BUILD_DATE }, 158 { "buildDate", IDS_ABOUT_VERSION_BUILD_DATE },
157 #endif 159 #endif
158 #if defined(OS_MACOSX) 160 #if defined(OS_MACOSX)
159 { "promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER }, 161 { "promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER },
160 { "learnMore", IDS_LEARN_MORE }, 162 { "learnMore", IDS_LEARN_MORE },
161 #endif 163 #endif
162 }; 164 };
163 165
166 if (chrome::send_feedback_experiment::UseAlternateText()) {
167 // Field trial to substitute "Report an Issue" with "Send Feedback".
168 // (crbug.com/169339)
169 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i) {
170 if (kResourceReportIssue == resources[i].name)
171 resources[i].ids = IDS_SEND_FEEDBACK;
172 }
173 }
174
164 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i) { 175 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i) {
165 source->AddString(resources[i].name, 176 source->AddString(resources[i].name,
166 l10n_util::GetStringUTF16(resources[i].ids)); 177 l10n_util::GetStringUTF16(resources[i].ids));
167 } 178 }
168 179
169 source->AddString( 180 source->AddString(
170 "browserVersion", 181 "browserVersion",
171 l10n_util::GetStringFUTF16(IDS_ABOUT_PRODUCT_VERSION, 182 l10n_util::GetStringFUTF16(IDS_ABOUT_PRODUCT_VERSION,
172 BuildBrowserVersionString())); 183 BuildBrowserVersionString()));
173 184
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 445
435 // Note that this string will be internationalized. 446 // Note that this string will be internationalized.
436 string16 build_date = base::TimeFormatFriendlyDate(time); 447 string16 build_date = base::TimeFormatFriendlyDate(time);
437 g_build_date_string = Value::CreateStringValue(build_date); 448 g_build_date_string = Value::CreateStringValue(build_date);
438 } 449 }
439 450
440 web_ui()->CallJavascriptFunction("help.HelpPage.setBuildDate", 451 web_ui()->CallJavascriptFunction("help.HelpPage.setBuildDate",
441 *g_build_date_string); 452 *g_build_date_string);
442 } 453 }
443 #endif // defined(OS_CHROMEOS) 454 #endif // defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698