Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_WEBAPKS_HANDLER_H_ | |
| 6 #define CHROME_BROWSER_UI_WEBUI_WEBAPKS_HANDLER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "base/values.h" | |
| 13 #include "chrome/browser/android/webapk/webapk_info.h" | |
| 14 #include "content/public/browser/web_ui_message_handler.h" | |
| 15 | |
| 16 // Handles JavaScript messages from the chrome://webapks page. | |
| 17 class WebApksHandler : public content::WebUIMessageHandler { | |
| 18 public: | |
| 19 WebApksHandler(); | |
| 20 ~WebApksHandler() override; | |
| 21 | |
| 22 // content::WebUIMessageHandler implementation. | |
|
pkotwicz
2017/01/20 16:57:17
Nit: "content::WebUIMessageHandler implementation.
gonzalon
2017/01/20 19:27:01
Done.
| |
| 23 void RegisterMessages() override; | |
| 24 | |
| 25 // Handler for the "requestWebApksInfo" message. This requests | |
| 26 // information for the installed WebAPKs and returns it to JS using | |
| 27 // OnWebApkInfoReceived(). | |
| 28 virtual void HandleRequestWebApksInfo(const base::ListValue* args); | |
| 29 | |
| 30 private: | |
| 31 // Sends information for the installed WebAPKs to JS. | |
| 32 void OnWebApkInfoReceived(std::vector<const WebApkInfo> webapks_list); | |
| 33 | |
| 34 // Factory for the creating refs in callbacks. | |
| 35 base::WeakPtrFactory<WebApksHandler> weak_ptr_factory_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(WebApksHandler); | |
| 38 }; | |
| 39 | |
| 40 #endif // CHROME_BROWSER_UI_WEBUI_WEBAPKS_HANDLER_H_ | |
| OLD | NEW |