Chromium Code Reviews| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 #endif | 133 #endif |
| 133 { "aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION }, | 134 { "aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION }, |
| 134 { "relaunch", IDS_RELAUNCH_BUTTON }, | 135 { "relaunch", IDS_RELAUNCH_BUTTON }, |
| 135 { "productName", IDS_PRODUCT_NAME }, | 136 { "productName", IDS_PRODUCT_NAME }, |
| 136 { "productCopyright", IDS_ABOUT_VERSION_COPYRIGHT }, | 137 { "productCopyright", IDS_ABOUT_VERSION_COPYRIGHT }, |
| 137 { "updateCheckStarted", IDS_UPGRADE_CHECK_STARTED }, | 138 { "updateCheckStarted", IDS_UPGRADE_CHECK_STARTED }, |
| 138 { "upToDate", IDS_UPGRADE_UP_TO_DATE }, | 139 { "upToDate", IDS_UPGRADE_UP_TO_DATE }, |
| 139 { "updating", IDS_UPGRADE_UPDATING }, | 140 { "updating", IDS_UPGRADE_UPDATING }, |
| 140 { "updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH }, | 141 { "updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH }, |
| 141 { "getHelpWithChrome", IDS_GET_HELP_USING_CHROME }, | 142 { "getHelpWithChrome", IDS_GET_HELP_USING_CHROME }, |
| 142 { "reportAnIssue", IDS_REPORT_AN_ISSUE }, | 143 { "reportAnIssue", IDS_REPORT_AN_ISSUE }, |
|
SteveT
2013/03/20 15:19:44
* (see below)
| |
| 143 #if defined(OS_CHROMEOS) | 144 #if defined(OS_CHROMEOS) |
| 144 { "platform", IDS_PLATFORM_LABEL }, | 145 { "platform", IDS_PLATFORM_LABEL }, |
| 145 { "firmware", IDS_ABOUT_PAGE_FIRMWARE }, | 146 { "firmware", IDS_ABOUT_PAGE_FIRMWARE }, |
| 146 { "showMoreInfo", IDS_SHOW_MORE_INFO }, | 147 { "showMoreInfo", IDS_SHOW_MORE_INFO }, |
| 147 { "hideMoreInfo", IDS_HIDE_MORE_INFO }, | 148 { "hideMoreInfo", IDS_HIDE_MORE_INFO }, |
| 148 { "channel", IDS_ABOUT_PAGE_CHANNEL }, | 149 { "channel", IDS_ABOUT_PAGE_CHANNEL }, |
| 149 { "stable", IDS_ABOUT_PAGE_CHANNEL_STABLE }, | 150 { "stable", IDS_ABOUT_PAGE_CHANNEL_STABLE }, |
| 150 { "beta", IDS_ABOUT_PAGE_CHANNEL_BETA }, | 151 { "beta", IDS_ABOUT_PAGE_CHANNEL_BETA }, |
| 151 { "dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT }, | 152 { "dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT }, |
| 152 { "channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED }, | 153 { "channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED }, |
| 153 { "webkit", IDS_WEBKIT }, | 154 { "webkit", IDS_WEBKIT }, |
| 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 kResourceReportIssue = "reportAnIssue"; | |
|
SteveT
2013/03/20 15:19:44
nit: Hmm.. just as a way to prevent future errors,
Harry McCleave
2013/03/20 21:30:55
Done.
| |
| 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 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 |