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/i18n/message_formatter.h" | 8 #include "base/i18n/message_formatter.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "components/strings/grit/components_strings.h" | 21 #include "components/strings/grit/components_strings.h" |
22 #include "components/version_info/version_info.h" | 22 #include "components/version_info/version_info.h" |
23 #include "components/version_ui/version_ui_constants.h" | 23 #include "components/version_ui/version_ui_constants.h" |
24 #include "content/public/browser/url_data_source.h" | 24 #include "content/public/browser/url_data_source.h" |
25 #include "content/public/browser/web_ui.h" | 25 #include "content/public/browser/web_ui.h" |
26 #include "content/public/browser/web_ui_data_source.h" | 26 #include "content/public/browser/web_ui_data_source.h" |
27 #include "content/public/common/user_agent.h" | 27 #include "content/public/common/user_agent.h" |
28 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
29 #include "v8/include/v8.h" | 29 #include "v8/include/v8.h" |
30 | 30 |
31 #if defined(ENABLE_THEMES) | |
32 #include "chrome/browser/ui/webui/theme_source.h" | |
33 #endif | |
34 | |
35 #if defined(OS_ANDROID) | 31 #if defined(OS_ANDROID) |
36 #include "base/android/build_info.h" | 32 #include "base/android/build_info.h" |
37 #include "chrome/browser/ui/android/android_about_app_info.h" | 33 #include "chrome/browser/ui/android/android_about_app_info.h" |
| 34 #else // !defined(OS_ANDROID) |
| 35 #include "chrome/browser/ui/webui/theme_source.h" |
38 #endif | 36 #endif |
39 | 37 |
40 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
41 #include "chrome/browser/ui/webui/version_handler_chromeos.h" | 39 #include "chrome/browser/ui/webui/version_handler_chromeos.h" |
42 #endif | 40 #endif |
43 | 41 |
44 using content::WebUIDataSource; | 42 using content::WebUIDataSource; |
45 | 43 |
46 namespace { | 44 namespace { |
47 | 45 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 VersionUI::VersionUI(content::WebUI* web_ui) | 158 VersionUI::VersionUI(content::WebUI* web_ui) |
161 : content::WebUIController(web_ui) { | 159 : content::WebUIController(web_ui) { |
162 Profile* profile = Profile::FromWebUI(web_ui); | 160 Profile* profile = Profile::FromWebUI(web_ui); |
163 | 161 |
164 #if defined(OS_CHROMEOS) | 162 #if defined(OS_CHROMEOS) |
165 web_ui->AddMessageHandler(new VersionHandlerChromeOS()); | 163 web_ui->AddMessageHandler(new VersionHandlerChromeOS()); |
166 #else | 164 #else |
167 web_ui->AddMessageHandler(new VersionHandler()); | 165 web_ui->AddMessageHandler(new VersionHandler()); |
168 #endif | 166 #endif |
169 | 167 |
170 #if defined(ENABLE_THEMES) | 168 #if !defined(OS_ANDROID) |
171 // Set up the chrome://theme/ source. | 169 // Set up the chrome://theme/ source. |
172 ThemeSource* theme = new ThemeSource(profile); | 170 ThemeSource* theme = new ThemeSource(profile); |
173 content::URLDataSource::Add(profile, theme); | 171 content::URLDataSource::Add(profile, theme); |
174 #endif | 172 #endif |
175 | 173 |
176 WebUIDataSource::Add(profile, CreateVersionUIDataSource()); | 174 WebUIDataSource::Add(profile, CreateVersionUIDataSource()); |
177 } | 175 } |
178 | 176 |
179 VersionUI::~VersionUI() { | 177 VersionUI::~VersionUI() { |
180 } | 178 } |
OLD | NEW |