| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 html_source->AddLocalizedString("profile_path_name", | 113 html_source->AddLocalizedString("profile_path_name", |
| 114 IDS_ABOUT_VERSION_PROFILE_PATH); | 114 IDS_ABOUT_VERSION_PROFILE_PATH); |
| 115 html_source->AddString("profile_path", std::string()); | 115 html_source->AddString("profile_path", std::string()); |
| 116 | 116 |
| 117 html_source->AddLocalizedString("variations_name", | 117 html_source->AddLocalizedString("variations_name", |
| 118 IDS_ABOUT_VERSION_VARIATIONS); | 118 IDS_ABOUT_VERSION_VARIATIONS); |
| 119 | 119 |
| 120 html_source->set_use_json_js_format_v2(); | 120 html_source->set_use_json_js_format_v2(); |
| 121 html_source->set_json_path("strings.js"); | 121 html_source->set_json_path("strings.js"); |
| 122 html_source->add_resource_path("version.js", IDR_ABOUT_VERSION_JS); | 122 html_source->add_resource_path("version.js", IDR_ABOUT_VERSION_JS); |
| 123 html_source->add_resource_path("about_version.css", IDR_ABOUT_VERSION_CSS); |
| 123 html_source->set_default_resource(IDR_ABOUT_VERSION_HTML); | 124 html_source->set_default_resource(IDR_ABOUT_VERSION_HTML); |
| 124 return html_source; | 125 return html_source; |
| 125 } | 126 } |
| 126 | 127 |
| 127 } // namespace | 128 } // namespace |
| 128 | 129 |
| 129 VersionUI::VersionUI(content::WebUI* web_ui) | 130 VersionUI::VersionUI(content::WebUI* web_ui) |
| 130 : content::WebUIController(web_ui) { | 131 : content::WebUIController(web_ui) { |
| 131 Profile* profile = Profile::FromWebUI(web_ui); | 132 Profile* profile = Profile::FromWebUI(web_ui); |
| 132 | 133 |
| 133 #if defined(OS_CHROMEOS) | 134 #if defined(OS_CHROMEOS) |
| 134 web_ui->AddMessageHandler(new VersionHandlerChromeOS()); | 135 web_ui->AddMessageHandler(new VersionHandlerChromeOS()); |
| 135 #else | 136 #else |
| 136 web_ui->AddMessageHandler(new VersionHandler()); | 137 web_ui->AddMessageHandler(new VersionHandler()); |
| 137 #endif | 138 #endif |
| 138 | 139 |
| 139 #if defined(ENABLE_THEMES) | 140 #if defined(ENABLE_THEMES) |
| 140 // Set up the chrome://theme/ source. | 141 // Set up the chrome://theme/ source. |
| 141 ThemeSource* theme = new ThemeSource(profile); | 142 ThemeSource* theme = new ThemeSource(profile); |
| 142 ChromeURLDataManager::AddDataSource(profile, theme); | 143 ChromeURLDataManager::AddDataSource(profile, theme); |
| 143 #endif | 144 #endif |
| 144 | 145 |
| 145 ChromeURLDataManager::AddDataSourceImpl(profile, | 146 ChromeURLDataManager::AddDataSourceImpl(profile, |
| 146 CreateVersionUIDataSource(profile)); | 147 CreateVersionUIDataSource(profile)); |
| 147 } | 148 } |
| 148 | 149 |
| 149 VersionUI::~VersionUI() { | 150 VersionUI::~VersionUI() { |
| 150 } | 151 } |
| OLD | NEW |