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