OLD | NEW |
---|---|
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 { "userAgent", IDS_ABOUT_VERSION_USER_AGENT }, | 155 { "userAgent", IDS_ABOUT_VERSION_USER_AGENT }, |
155 { "commandLine", IDS_ABOUT_VERSION_COMMAND_LINE }, | 156 { "commandLine", IDS_ABOUT_VERSION_COMMAND_LINE }, |
156 { "buildDate", IDS_ABOUT_VERSION_BUILD_DATE }, | 157 { "buildDate", IDS_ABOUT_VERSION_BUILD_DATE }, |
157 #endif | 158 #endif |
158 #if defined(OS_MACOSX) | 159 #if defined(OS_MACOSX) |
159 { "promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER }, | 160 { "promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER }, |
160 { "learnMore", IDS_LEARN_MORE }, | 161 { "learnMore", IDS_LEARN_MORE }, |
161 #endif | 162 #endif |
162 }; | 163 }; |
163 | 164 |
165 if (chrome::send_feedback_experiment::UseAlternateText()) { | |
166 const std::string sResourceReportIssue = "reportAnIssue"; | |
SteveT
2013/03/19 14:38:58
nit: does the "s" stand for "string" in sResourceR
Harry McCleave
2013/03/19 22:23:29
Done.
| |
167 // Finch experiment to substitute "Report an Issue" | |
SteveT
2013/03/19 14:38:58
Please avoid using the term "Finch". You can just
Harry McCleave
2013/03/19 22:23:29
Done.
| |
168 // with "Send Feedback" crbug.com/169339. | |
169 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i) { | |
170 if (sResourceReportIssue == 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 Loading... | |
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) |
OLD | NEW |