| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/ui/webui/version_ui.h" | 5 #include "ios/chrome/browser/ui/webui/version_ui.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 11 #include "components/grit/components_resources.h" | 12 #include "components/grit/components_resources.h" |
| 12 #include "components/strings/grit/components_chromium_strings.h" | 13 #include "components/strings/grit/components_chromium_strings.h" |
| 13 #include "components/strings/grit/components_google_chrome_strings.h" | 14 #include "components/strings/grit/components_google_chrome_strings.h" |
| 14 #include "components/strings/grit/components_strings.h" | 15 #include "components/strings/grit/components_strings.h" |
| 15 #include "components/version_info/version_info.h" | 16 #include "components/version_info/version_info.h" |
| 16 #include "components/version_ui/version_ui_constants.h" | 17 #include "components/version_ui/version_ui_constants.h" |
| 17 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 18 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 html_source->AddResourcePath(version_ui::kVersionJS, IDR_VERSION_UI_JS); | 102 html_source->AddResourcePath(version_ui::kVersionJS, IDR_VERSION_UI_JS); |
| 102 html_source->AddResourcePath(version_ui::kAboutVersionCSS, | 103 html_source->AddResourcePath(version_ui::kAboutVersionCSS, |
| 103 IDR_VERSION_UI_CSS); | 104 IDR_VERSION_UI_CSS); |
| 104 html_source->SetDefaultResource(IDR_VERSION_UI_HTML); | 105 html_source->SetDefaultResource(IDR_VERSION_UI_HTML); |
| 105 return html_source; | 106 return html_source; |
| 106 } | 107 } |
| 107 | 108 |
| 108 } // namespace | 109 } // namespace |
| 109 | 110 |
| 110 VersionUI::VersionUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { | 111 VersionUI::VersionUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { |
| 111 web_ui->AddMessageHandler(new VersionHandler()); | 112 web_ui->AddMessageHandler(base::MakeUnique<VersionHandler>()); |
| 112 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), | 113 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), |
| 113 CreateVersionUIDataSource()); | 114 CreateVersionUIDataSource()); |
| 114 } | 115 } |
| 115 | 116 |
| 116 VersionUI::~VersionUI() {} | 117 VersionUI::~VersionUI() {} |
| OLD | NEW |