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

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

Issue 2629573004: Add a chrome://webapks page. (Closed)
Patch Set: Add a chrome://webapks page. Created 3 years, 10 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..7d051ee8a1e5c2075c623d4ff571917acd7faddb
--- /dev/null
+++ b/chrome/browser/ui/webui/webapks_handler.h
@@ -0,0 +1,43 @@
+// Copyright 2017 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.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_WEBAPKS_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_WEBAPKS_HANDLER_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/android/webapk/webapk_info.h"
+#include "content/public/browser/web_ui_message_handler.h"
+
+namespace base {
+class ListValue;
+} // namespace base
+
+// Handles JavaScript messages from the chrome://webapks page.
+class WebApksHandler : public content::WebUIMessageHandler {
+ public:
+ WebApksHandler();
+ ~WebApksHandler() override;
+
+ // content::WebUIMessageHandler:
+ void RegisterMessages() override;
+
+ // Handler for the "requestWebApksInfo" message. This requests
+ // information for the installed WebAPKs and returns it to JS using
+ // OnWebApkInfoReceived().
+ virtual void HandleRequestWebApksInfo(const base::ListValue* args);
+
+ private:
+ // Sends information for the installed WebAPKs to JS.
+ void OnWebApkInfoRetrieved(const std::vector<WebApkInfo>& webapks_list);
+
+ // 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_
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc ('k') | chrome/browser/ui/webui/webapks_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698