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

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: . 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
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_menu_model.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 char kResourceReportIssue[] = "reportAnIssue";
58
56 // Returns the browser version as a string. 59 // Returns the browser version as a string.
57 string16 BuildBrowserVersionString() { 60 string16 BuildBrowserVersionString() {
58 chrome::VersionInfo version_info; 61 chrome::VersionInfo version_info;
59 DCHECK(version_info.is_valid()); 62 DCHECK(version_info.is_valid());
60 63
61 std::string browser_version = version_info.Version(); 64 std::string browser_version = version_info.Version();
62 std::string version_modifier = 65 std::string version_modifier =
63 chrome::VersionInfo::GetVersionStringModifier(); 66 chrome::VersionInfo::GetVersionStringModifier();
64 if (!version_modifier.empty()) 67 if (!version_modifier.empty())
65 browser_version += " " + version_modifier; 68 browser_version += " " + version_modifier;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 #endif 135 #endif
133 { "aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION }, 136 { "aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION },
134 { "relaunch", IDS_RELAUNCH_BUTTON }, 137 { "relaunch", IDS_RELAUNCH_BUTTON },
135 { "productName", IDS_PRODUCT_NAME }, 138 { "productName", IDS_PRODUCT_NAME },
136 { "productCopyright", IDS_ABOUT_VERSION_COPYRIGHT }, 139 { "productCopyright", IDS_ABOUT_VERSION_COPYRIGHT },
137 { "updateCheckStarted", IDS_UPGRADE_CHECK_STARTED }, 140 { "updateCheckStarted", IDS_UPGRADE_CHECK_STARTED },
138 { "upToDate", IDS_UPGRADE_UP_TO_DATE }, 141 { "upToDate", IDS_UPGRADE_UP_TO_DATE },
139 { "updating", IDS_UPGRADE_UPDATING }, 142 { "updating", IDS_UPGRADE_UPDATING },
140 { "updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH }, 143 { "updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH },
141 { "getHelpWithChrome", IDS_GET_HELP_USING_CHROME }, 144 { "getHelpWithChrome", IDS_GET_HELP_USING_CHROME },
142 { "reportAnIssue", IDS_REPORT_AN_ISSUE }, 145 { kResourceReportIssue, IDS_REPORT_AN_ISSUE },
143 #if defined(OS_CHROMEOS) 146 #if defined(OS_CHROMEOS)
144 { "platform", IDS_PLATFORM_LABEL }, 147 { "platform", IDS_PLATFORM_LABEL },
145 { "firmware", IDS_ABOUT_PAGE_FIRMWARE }, 148 { "firmware", IDS_ABOUT_PAGE_FIRMWARE },
146 { "showMoreInfo", IDS_SHOW_MORE_INFO }, 149 { "showMoreInfo", IDS_SHOW_MORE_INFO },
147 { "hideMoreInfo", IDS_HIDE_MORE_INFO }, 150 { "hideMoreInfo", IDS_HIDE_MORE_INFO },
148 { "channel", IDS_ABOUT_PAGE_CHANNEL }, 151 { "channel", IDS_ABOUT_PAGE_CHANNEL },
149 { "stable", IDS_ABOUT_PAGE_CHANNEL_STABLE }, 152 { "stable", IDS_ABOUT_PAGE_CHANNEL_STABLE },
150 { "beta", IDS_ABOUT_PAGE_CHANNEL_BETA }, 153 { "beta", IDS_ABOUT_PAGE_CHANNEL_BETA },
151 { "dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT }, 154 { "dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT },
152 { "channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED }, 155 { "channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED },
153 { "webkit", IDS_WEBKIT }, 156 { "webkit", IDS_WEBKIT },
154 { "userAgent", IDS_ABOUT_VERSION_USER_AGENT }, 157 { "userAgent", IDS_ABOUT_VERSION_USER_AGENT },
155 { "commandLine", IDS_ABOUT_VERSION_COMMAND_LINE }, 158 { "commandLine", IDS_ABOUT_VERSION_COMMAND_LINE },
156 { "buildDate", IDS_ABOUT_VERSION_BUILD_DATE }, 159 { "buildDate", IDS_ABOUT_VERSION_BUILD_DATE },
157 #endif 160 #endif
158 #if defined(OS_MACOSX) 161 #if defined(OS_MACOSX)
159 { "promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER }, 162 { "promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER },
160 { "learnMore", IDS_LEARN_MORE }, 163 { "learnMore", IDS_LEARN_MORE },
161 #endif 164 #endif
162 }; 165 };
163 166
167 if (chrome::UseAlternateSendFeedbackText()) {
168 // Field trial to substitute "Report an Issue" with "Send Feedback".
169 // (crbug.com/169339)
170 std::string report_issue_key(kResourceReportIssue);
171 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i) {
172 if (report_issue_key == resources[i].name)
173 resources[i].ids = IDS_SEND_FEEDBACK;
174 }
175 }
176
164 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i) { 177 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i) {
165 source->AddString(resources[i].name, 178 source->AddString(resources[i].name,
166 l10n_util::GetStringUTF16(resources[i].ids)); 179 l10n_util::GetStringUTF16(resources[i].ids));
167 } 180 }
168 181
169 source->AddString( 182 source->AddString(
170 "browserVersion", 183 "browserVersion",
171 l10n_util::GetStringFUTF16(IDS_ABOUT_PRODUCT_VERSION, 184 l10n_util::GetStringFUTF16(IDS_ABOUT_PRODUCT_VERSION,
172 BuildBrowserVersionString())); 185 BuildBrowserVersionString()));
173 186
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 447
435 // Note that this string will be internationalized. 448 // Note that this string will be internationalized.
436 string16 build_date = base::TimeFormatFriendlyDate(time); 449 string16 build_date = base::TimeFormatFriendlyDate(time);
437 g_build_date_string = Value::CreateStringValue(build_date); 450 g_build_date_string = Value::CreateStringValue(build_date);
438 } 451 }
439 452
440 web_ui()->CallJavascriptFunction("help.HelpPage.setBuildDate", 453 web_ui()->CallJavascriptFunction("help.HelpPage.setBuildDate",
441 *g_build_date_string); 454 *g_build_date_string);
442 } 455 }
443 #endif // defined(OS_CHROMEOS) 456 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_menu_model.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698