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

Unified Diff: chrome/browser/ui/webui/webapks_handler.h

Issue 2629573004: Add a chrome://webapks page. (Closed)
Patch Set: Adds an about:webapks page with information about all installed Web APKs on the device Created 3 years, 11 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
Index: chrome/browser/ui/webui/webapks_handler.h
diff --git a/chrome/browser/ui/webui/webapks_handler.h b/chrome/browser/ui/webui/webapks_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..9be64f1278f305bd7dd3045e9c6d2b037d1f3419
--- /dev/null
+++ b/chrome/browser/ui/webui/webapks_handler.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
hartmanng 2017/01/13 15:40:21 s/(c) 2012/2017/
gonzalon 2017/01/13 20:24:39 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_WEBAPKS_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_WEBAPKS_HANDLER_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/values.h"
+#include "content/public/browser/web_ui_message_handler.h"
+
+// Handler class for WebAPKs page operations.
+class WebAPKsHandler : public content::WebUIMessageHandler {
+ public:
+ WebAPKsHandler();
+ ~WebAPKsHandler() override;
+
+ // content::WebUIMessageHandler implementation.
+ void RegisterMessages() override;
+
+ // Callback for the "requestWebAPKsInfo" message. This requests the Web APKs
+ // information from the device and returns it to the front end using
+ // OnWebApkInfoReceived
+ virtual void HandleRequestWebAPKsInfo(const base::ListValue* args);
+
+ private:
+ // Callback which handles returning the information of a single Web APK to the
+ // front end.
+ void OnWebApkInfoReceived(std::string name,
+ std::string package_name,
+ int shell_apk_version,
+ int version_code);
+
+ // Factory for the creating refs in callbacks.
+ base::WeakPtrFactory<WebAPKsHandler> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebAPKsHandler);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_WEBAPKS_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698