Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: ios/chrome/browser/ui/webui/version_handler.cc

Issue 1418653004: [iOS] Support for chrome://version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment from blundell Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/webui/version_handler.h ('k') | ios/chrome/browser/ui/webui/version_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/webui/version_handler.cc
diff --git a/ios/chrome/browser/ui/webui/version_handler.cc b/ios/chrome/browser/ui/webui/version_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9dd03a150f68e50d49cfec079887e159e6bce602
--- /dev/null
+++ b/ios/chrome/browser/ui/webui/version_handler.cc
@@ -0,0 +1,31 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/chrome/browser/ui/webui/version_handler.h"
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/values.h"
+#include "components/version_ui/version_handler_helper.h"
+#include "components/version_ui/version_ui_constants.h"
+#include "ios/public/provider/web/web_ui_ios.h"
+#include "ui/base/l10n/l10n_util.h"
+
+VersionHandler::VersionHandler() {}
+
+VersionHandler::~VersionHandler() {}
+
+void VersionHandler::RegisterMessages() {
+ web_ui()->RegisterMessageCallback(
+ version_ui::kRequestVersionInfo,
+ base::Bind(&VersionHandler::HandleRequestVersionInfo,
+ base::Unretained(this)));
+}
+
+void VersionHandler::HandleRequestVersionInfo(const base::ListValue* args) {
+ // Respond with the variations info immediately.
+ web_ui()->CallJavascriptFunction(version_ui::kReturnVariationInfo,
+ *version_ui::GetVariationsList());
+}
« no previous file with comments | « ios/chrome/browser/ui/webui/version_handler.h ('k') | ios/chrome/browser/ui/webui/version_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698