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 <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/values.h" |
| 13 #include "content/public/browser/web_ui_message_handler.h" |
| 14 |
| 15 // Handler class for WebAPKs page operations. |
| 16 class WebApksHandler : public content::WebUIMessageHandler { |
| 17 public: |
| 18 WebApksHandler(); |
| 19 ~WebApksHandler() override; |
| 20 |
| 21 // content::WebUIMessageHandler implementation. |
| 22 void RegisterMessages() override; |
| 23 |
| 24 // Callback for the "requestWebApksInfo" message. This requests the WebAPKs |
| 25 // information from the device and returns it to the front end using |
| 26 // OnWebApkInfoReceived |
| 27 virtual void HandleRequestWebApksInfo(const base::ListValue* args); |
| 28 |
| 29 private: |
| 30 // Callback which handles returning the information of a single WebAPK to the |
| 31 // front end. |
| 32 void OnWebApkInfoReceived(std::string name, |
| 33 std::string package_name, |
| 34 int shell_apk_version, |
| 35 int version_code); |
| 36 |
| 37 // Factory for the creating refs in callbacks. |
| 38 base::WeakPtrFactory<WebApksHandler> weak_ptr_factory_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(WebApksHandler); |
| 41 }; |
| 42 |
| 43 #endif // CHROME_BROWSER_UI_WEBUI_WEBAPKS_HANDLER_H_ |
OLD | NEW |