| 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/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) | 88 for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) |
| 89 command_line += " " + *iter; | 89 command_line += " " + *iter; |
| 90 // TODO(viettrungluu): |command_line| could really have any encoding, whereas | 90 // TODO(viettrungluu): |command_line| could really have any encoding, whereas |
| 91 // below we assumes it's UTF-8. | 91 // below we assumes it's UTF-8. |
| 92 html_source->AddString(version_ui::kCommandLine, command_line); | 92 html_source->AddString(version_ui::kCommandLine, command_line); |
| 93 | 93 |
| 94 html_source->AddLocalizedString(version_ui::kVariationsName, | 94 html_source->AddLocalizedString(version_ui::kVariationsName, |
| 95 IDS_VERSION_UI_VARIATIONS); | 95 IDS_VERSION_UI_VARIATIONS); |
| 96 | 96 |
| 97 html_source->SetJsonPath("strings.js"); | 97 html_source->SetJsonPath("strings.js"); |
| 98 html_source->AddResourcePath(version_ui::kVersionJS, IDR_VERSION_UI_JS); | 98 html_source->AddResourcePath(version_ui::kVersionJS, IDR_VERSION_UI_IOS_JS); |
| 99 html_source->AddResourcePath(version_ui::kAboutVersionCSS, | 99 html_source->AddResourcePath(version_ui::kAboutVersionCSS, |
| 100 IDR_VERSION_UI_CSS); | 100 IDR_VERSION_UI_CSS); |
| 101 html_source->SetDefaultResource(IDR_VERSION_UI_HTML); | 101 html_source->SetDefaultResource(IDR_VERSION_UI_HTML); |
| 102 return html_source; | 102 return html_source; |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace | 105 } // namespace |
| 106 | 106 |
| 107 VersionUI::VersionUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { | 107 VersionUI::VersionUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { |
| 108 web_ui->AddMessageHandler(new VersionHandler()); | 108 web_ui->AddMessageHandler(new VersionHandler()); |
| 109 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), | 109 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), |
| 110 CreateVersionUIDataSource()); | 110 CreateVersionUIDataSource()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 VersionUI::~VersionUI() {} | 113 VersionUI::~VersionUI() {} |
| OLD | NEW |