Chromium Code Reviews| 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..852c69446ca115bebb85ca87e180260386855599 |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/webapks_handler.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright (c) 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 <string> |
|
pkotwicz
2017/01/19 19:37:17
I don't think this include is needed
gonzalon
2017/01/19 23:50:17
Done.
|
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/values.h" |
|
pkotwicz
2017/01/19 19:37:17
Nit: You can forward declare base::ListValue and m
pkotwicz
2017/01/20 16:57:17
^^^ I think that you missed this comment
|
| +#include "chrome/browser/android/webapk/webapk_info.h" |
|
pkotwicz
2017/01/19 19:37:17
I think you can also forward declare WebApkInfo
pkotwicz
2017/01/20 16:57:17
^^^ I think that you missed this comment
|
| +#include "content/public/browser/web_ui_message_handler.h" |
| + |
| +// Handler class for WebAPKs page operations. |
|
pkotwicz
2017/01/19 19:37:17
How about: "Handles JavaScript messages from the c
gonzalon
2017/01/19 23:50:17
Done.
|
| +class WebApksHandler : public content::WebUIMessageHandler { |
| + public: |
| + WebApksHandler(); |
| + ~WebApksHandler() override; |
| + |
| + // content::WebUIMessageHandler implementation. |
| + void RegisterMessages() override; |
| + |
| + // Callback for the "requestWebApksInfo" message. This requests the WebAPKs |
| + // information from the device and returns it to the front end using |
| + // OnWebApkInfoReceived |
|
pkotwicz
2017/01/19 19:37:17
How about: "Handler for the "requestWebApksInfo" m
gonzalon
2017/01/19 23:50:17
Done.
|
| + virtual void HandleRequestWebApksInfo(const base::ListValue* args); |
| + |
| + private: |
| + // Callback which handles returning the information of a single WebAPK to the |
| + // front end. |
|
pkotwicz
2017/01/19 19:37:17
This comment looks out of date. How about:
"Sends
gonzalon
2017/01/19 23:50:17
Done.
|
| + void OnWebApkInfoReceived(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_ |