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/version_ui.h" | 5 #include "chrome/browser/ui/webui/version_ui.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/webui/version_handler.h" | 11 #include "chrome/browser/ui/webui/version_handler.h" |
| 12 #include "chrome/common/chrome_content_client.h" |
12 #include "chrome/common/chrome_version_info.h" | 13 #include "chrome/common/chrome_version_info.h" |
13 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
14 #include "content/public/browser/url_data_source.h" | 15 #include "content/public/browser/url_data_source.h" |
15 #include "content/public/browser/web_ui.h" | 16 #include "content/public/browser/web_ui.h" |
16 #include "content/public/browser/web_ui_data_source.h" | 17 #include "content/public/browser/web_ui_data_source.h" |
17 #include "content/public/common/content_client.h" | |
18 #include "grit/browser_resources.h" | 18 #include "grit/browser_resources.h" |
19 #include "grit/chromium_strings.h" | 19 #include "grit/chromium_strings.h" |
20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
21 #include "grit/google_chrome_strings.h" | 21 #include "grit/google_chrome_strings.h" |
22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
23 #include "v8/include/v8.h" | 23 #include "v8/include/v8.h" |
24 #include "webkit/common/user_agent/user_agent_util.h" | 24 #include "webkit/common/user_agent/user_agent_util.h" |
25 | 25 |
26 #if defined(ENABLE_THEMES) | 26 #if defined(ENABLE_THEMES) |
27 #include "chrome/browser/ui/webui/theme_source.h" | 27 #include "chrome/browser/ui/webui/theme_source.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 html_source->AddString( | 85 html_source->AddString( |
86 "copyright", | 86 "copyright", |
87 l10n_util::GetStringFUTF16(IDS_ABOUT_VERSION_COPYRIGHT, | 87 l10n_util::GetStringFUTF16(IDS_ABOUT_VERSION_COPYRIGHT, |
88 base::IntToString16(exploded_time.year))); | 88 base::IntToString16(exploded_time.year))); |
89 html_source->AddString("cl", version_info.LastChange()); | 89 html_source->AddString("cl", version_info.LastChange()); |
90 html_source->AddLocalizedString("official", | 90 html_source->AddLocalizedString("official", |
91 version_info.IsOfficialBuild() ? IDS_ABOUT_VERSION_OFFICIAL : | 91 version_info.IsOfficialBuild() ? IDS_ABOUT_VERSION_OFFICIAL : |
92 IDS_ABOUT_VERSION_UNOFFICIAL); | 92 IDS_ABOUT_VERSION_UNOFFICIAL); |
93 html_source->AddLocalizedString("user_agent_name", | 93 html_source->AddLocalizedString("user_agent_name", |
94 IDS_ABOUT_VERSION_USER_AGENT); | 94 IDS_ABOUT_VERSION_USER_AGENT); |
95 html_source->AddString("useragent", content::GetUserAgent(GURL())); | 95 html_source->AddString("useragent", GetUserAgent()); |
96 html_source->AddLocalizedString("command_line_name", | 96 html_source->AddLocalizedString("command_line_name", |
97 IDS_ABOUT_VERSION_COMMAND_LINE); | 97 IDS_ABOUT_VERSION_COMMAND_LINE); |
98 | 98 |
99 #if defined(OS_WIN) | 99 #if defined(OS_WIN) |
100 html_source->AddString("command_line", base::WideToUTF16( | 100 html_source->AddString("command_line", base::WideToUTF16( |
101 CommandLine::ForCurrentProcess()->GetCommandLineString())); | 101 CommandLine::ForCurrentProcess()->GetCommandLineString())); |
102 #elif defined(OS_POSIX) | 102 #elif defined(OS_POSIX) |
103 std::string command_line; | 103 std::string command_line; |
104 typedef std::vector<std::string> ArgvList; | 104 typedef std::vector<std::string> ArgvList; |
105 const ArgvList& argv = CommandLine::ForCurrentProcess()->argv(); | 105 const ArgvList& argv = CommandLine::ForCurrentProcess()->argv(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // Set up the chrome://theme/ source. | 148 // Set up the chrome://theme/ source. |
149 ThemeSource* theme = new ThemeSource(profile); | 149 ThemeSource* theme = new ThemeSource(profile); |
150 content::URLDataSource::Add(profile, theme); | 150 content::URLDataSource::Add(profile, theme); |
151 #endif | 151 #endif |
152 | 152 |
153 content::WebUIDataSource::Add(profile, CreateVersionUIDataSource(profile)); | 153 content::WebUIDataSource::Add(profile, CreateVersionUIDataSource(profile)); |
154 } | 154 } |
155 | 155 |
156 VersionUI::~VersionUI() { | 156 VersionUI::~VersionUI() { |
157 } | 157 } |
OLD | NEW |