| 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" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 "channelChangePageDelayedChangeMessage", | 271 "channelChangePageDelayedChangeMessage", |
| 272 l10n_util::GetStringFUTF16( | 272 l10n_util::GetStringFUTF16( |
| 273 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_DELAYED_CHANGE_MESSAGE, | 273 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_DELAYED_CHANGE_MESSAGE, |
| 274 product_name)); | 274 product_name)); |
| 275 localized_strings->SetString( | 275 localized_strings->SetString( |
| 276 "channelChangePageUnstableMessage", | 276 "channelChangePageUnstableMessage", |
| 277 l10n_util::GetStringFUTF16( | 277 l10n_util::GetStringFUTF16( |
| 278 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_UNSTABLE_MESSAGE, | 278 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_UNSTABLE_MESSAGE, |
| 279 product_name)); | 279 product_name)); |
| 280 | 280 |
| 281 if (CommandLine::ForCurrentProcess()-> | 281 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 282 HasSwitch(chromeos::switches::kDisableNewChannelSwitcherUI)) { | 282 chromeos::switches::kDisableNewChannelSwitcherUI)) { |
| 283 localized_strings->SetBoolean("disableNewChannelSwitcherUI", true); | 283 localized_strings->SetBoolean("disableNewChannelSwitcherUI", true); |
| 284 } | 284 } |
| 285 #endif | 285 #endif |
| 286 | 286 |
| 287 base::string16 tos = l10n_util::GetStringFUTF16( | 287 base::string16 tos = l10n_util::GetStringFUTF16( |
| 288 IDS_ABOUT_TERMS_OF_SERVICE, base::UTF8ToUTF16(chrome::kChromeUITermsURL)); | 288 IDS_ABOUT_TERMS_OF_SERVICE, base::UTF8ToUTF16(chrome::kChromeUITermsURL)); |
| 289 localized_strings->SetString("productTOS", tos); | 289 localized_strings->SetString("productTOS", tos); |
| 290 | 290 |
| 291 localized_strings->SetString("webkitVersion", content::GetWebKitVersion()); | 291 localized_strings->SetString("webkitVersion", content::GetWebKitVersion()); |
| 292 | 292 |
| 293 localized_strings->SetString("jsEngine", "V8"); | 293 localized_strings->SetString("jsEngine", "V8"); |
| 294 localized_strings->SetString("jsEngineVersion", v8::V8::GetVersion()); | 294 localized_strings->SetString("jsEngineVersion", v8::V8::GetVersion()); |
| 295 | 295 |
| 296 localized_strings->SetString("userAgentInfo", GetUserAgent()); | 296 localized_strings->SetString("userAgentInfo", GetUserAgent()); |
| 297 | 297 |
| 298 CommandLine::StringType command_line = | 298 base::CommandLine::StringType command_line = |
| 299 CommandLine::ForCurrentProcess()->GetCommandLineString(); | 299 base::CommandLine::ForCurrentProcess()->GetCommandLineString(); |
| 300 localized_strings->SetString("commandLineInfo", command_line); | 300 localized_strings->SetString("commandLineInfo", command_line); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void HelpHandler::RegisterMessages() { | 303 void HelpHandler::RegisterMessages() { |
| 304 #if defined(OS_CHROMEOS) | 304 #if defined(OS_CHROMEOS) |
| 305 version_updater_.reset( | 305 version_updater_.reset( |
| 306 VersionUpdater::Create(web_ui()->GetWebContents()->GetBrowserContext())); | 306 VersionUpdater::Create(web_ui()->GetWebContents()->GetBrowserContext())); |
| 307 #endif | 307 #endif |
| 308 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED, | 308 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED, |
| 309 content::NotificationService::AllSources()); | 309 content::NotificationService::AllSources()); |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 } | 612 } |
| 613 | 613 |
| 614 void HelpHandler::OnFCCLabelTextRead(const std::string& text) { | 614 void HelpHandler::OnFCCLabelTextRead(const std::string& text) { |
| 615 // Remove unnecessary whitespace. | 615 // Remove unnecessary whitespace. |
| 616 web_ui()->CallJavascriptFunction( | 616 web_ui()->CallJavascriptFunction( |
| 617 "help.HelpPage.setProductLabelText", | 617 "help.HelpPage.setProductLabelText", |
| 618 base::StringValue(base::CollapseWhitespaceASCII(text, true))); | 618 base::StringValue(base::CollapseWhitespaceASCII(text, true))); |
| 619 } | 619 } |
| 620 | 620 |
| 621 #endif // defined(OS_CHROMEOS) | 621 #endif // defined(OS_CHROMEOS) |
| OLD | NEW |