| 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_handler.h" | 5 #include "ios/chrome/browser/ui/webui/version_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | |
| 8 #include "base/bind_helpers.h" | |
| 9 #include "base/values.h" | |
| 10 #include "components/version_ui/version_handler_helper.h" | 7 #include "components/version_ui/version_handler_helper.h" |
| 11 #include "components/version_ui/version_ui_constants.h" | 8 #include "components/version_ui/version_ui_constants.h" |
| 12 #include "ios/web/public/webui/web_ui_ios.h" | 9 #include "ios/web/public/webui/web_ui_ios.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| 14 | 11 |
| 15 VersionHandler::VersionHandler() {} | 12 VersionHandler::VersionHandler( |
| 13 mojo::InterfaceRequest<mojom::VersionPageHandler> request) |
| 14 : binding_(this, std::move(request)) {} |
| 16 | 15 |
| 17 VersionHandler::~VersionHandler() {} | 16 VersionHandler::~VersionHandler() {} |
| 18 | 17 |
| 19 void VersionHandler::RegisterMessages() { | 18 void VersionHandler::GetFilePaths(const GetFilePathsCallback& callback) { |
| 20 web_ui()->RegisterMessageCallback( | 19 NOTREACHED(); |
| 21 version_ui::kRequestVersionInfo, | |
| 22 base::Bind(&VersionHandler::HandleRequestVersionInfo, | |
| 23 base::Unretained(this))); | |
| 24 } | 20 } |
| 25 | 21 |
| 26 void VersionHandler::HandleRequestVersionInfo(const base::ListValue* args) { | 22 void VersionHandler::GetFlashVersion(const GetFlashVersionCallback& callback) { |
| 27 // Respond with the variations info immediately. | 23 NOTREACHED(); |
| 28 web_ui()->CallJavascriptFunction(version_ui::kReturnVariationInfo, | |
| 29 *version_ui::GetVariationsList()); | |
| 30 } | 24 } |
| 25 |
| 26 void VersionHandler::GetVariations(const GetVariationsCallback& callback) { |
| 27 std::vector<std::string> variations = version_ui::GetVariations(); |
| 28 callback.Run(mojo::Array<mojo::String>::From(variations)); |
| 29 } |
| 30 |
| 31 void VersionHandler::GetOsVersion(const GetOsVersionCallback& callback) { |
| 32 NOTREACHED(); |
| 33 } |
| 34 |
| 35 void VersionHandler::GetArcVersion(const GetArcVersionCallback& callback) { |
| 36 NOTREACHED(); |
| 37 } |
| OLD | NEW |