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/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "base/task_runner_util.h" | 20 #include "base/task_runner_util.h" |
21 #include "base/values.h" | 21 #include "base/values.h" |
22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
23 #include "chrome/browser/chrome_notification_types.h" | 23 #include "chrome/browser/chrome_notification_types.h" |
24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
25 #include "chrome/browser/ui/browser_commands.h" | 25 #include "chrome/browser/ui/browser_commands.h" |
26 #include "chrome/browser/ui/browser_finder.h" | 26 #include "chrome/browser/ui/browser_finder.h" |
27 #include "chrome/browser/ui/chrome_pages.h" | 27 #include "chrome/browser/ui/chrome_pages.h" |
| 28 #include "chrome/common/channel_info.h" |
28 #include "chrome/common/chrome_content_client.h" | 29 #include "chrome/common/chrome_content_client.h" |
29 #include "chrome/common/chrome_version_info.h" | |
30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
32 #include "chrome/grit/chromium_strings.h" | 32 #include "chrome/grit/chromium_strings.h" |
33 #include "chrome/grit/generated_resources.h" | 33 #include "chrome/grit/generated_resources.h" |
34 #include "components/google/core/browser/google_util.h" | 34 #include "components/google/core/browser/google_util.h" |
| 35 #include "components/version_info/version_info.h" |
35 #include "content/public/browser/browser_thread.h" | 36 #include "content/public/browser/browser_thread.h" |
36 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
37 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
38 #include "content/public/browser/web_ui.h" | 39 #include "content/public/browser/web_ui.h" |
39 #include "content/public/common/user_agent.h" | 40 #include "content/public/common/user_agent.h" |
40 #include "grit/components_strings.h" | 41 #include "grit/components_strings.h" |
41 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
42 #include "v8/include/v8.h" | 43 #include "v8/include/v8.h" |
43 | 44 |
44 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 RequestUpdate(NULL); | 376 RequestUpdate(NULL); |
376 break; | 377 break; |
377 } | 378 } |
378 default: | 379 default: |
379 NOTREACHED(); | 380 NOTREACHED(); |
380 } | 381 } |
381 } | 382 } |
382 | 383 |
383 // static | 384 // static |
384 base::string16 HelpHandler::BuildBrowserVersionString() { | 385 base::string16 HelpHandler::BuildBrowserVersionString() { |
385 chrome::VersionInfo version_info; | 386 std::string version = version_info::GetVersionNumber(); |
386 | 387 |
387 std::string version = version_info.Version(); | 388 std::string modifier = chrome::GetChannelString(); |
388 | |
389 std::string modifier = chrome::VersionInfo::GetVersionStringModifier(); | |
390 if (!modifier.empty()) | 389 if (!modifier.empty()) |
391 version += " " + modifier; | 390 version += " " + modifier; |
392 | 391 |
393 #if defined(ARCH_CPU_64_BITS) | 392 #if defined(ARCH_CPU_64_BITS) |
394 version += " (64-bit)"; | 393 version += " (64-bit)"; |
395 #endif | 394 #endif |
396 | 395 |
397 return base::UTF8ToUTF16(version); | 396 return base::UTF8ToUTF16(version); |
398 } | 397 } |
399 | 398 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 } | 662 } |
664 | 663 |
665 void HelpHandler::OnRegulatoryLabelTextRead(const std::string& text) { | 664 void HelpHandler::OnRegulatoryLabelTextRead(const std::string& text) { |
666 // Remove unnecessary whitespace. | 665 // Remove unnecessary whitespace. |
667 web_ui()->CallJavascriptFunction( | 666 web_ui()->CallJavascriptFunction( |
668 "help.HelpPage.setRegulatoryLabelText", | 667 "help.HelpPage.setRegulatoryLabelText", |
669 base::StringValue(base::CollapseWhitespaceASCII(text, true))); | 668 base::StringValue(base::CollapseWhitespaceASCII(text, true))); |
670 } | 669 } |
671 | 670 |
672 #endif // defined(OS_CHROMEOS) | 671 #endif // defined(OS_CHROMEOS) |
OLD | NEW |