OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_EXTENSION_STATUSES_HA
NDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_EXTENSION_STATUSES_HA
NDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_EXTENSION_STATUSES_HA
NDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_EXTENSION_STATUSES_HA
NDLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/weak_ptr.h" |
9 #include "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
10 | 11 |
11 class Profile; | 12 class Profile; |
12 | 13 |
13 namespace syncfs_internals { | 14 namespace syncfs_internals { |
14 | 15 |
15 // This class handles message from WebUI page of chrome://syncfs-internals/ | 16 // This class handles message from WebUI page of chrome://syncfs-internals/ |
16 // for the Extension Statuses tab. It corresponds to browser/resources/ | 17 // for the Extension Statuses tab. It corresponds to browser/resources/ |
17 // sync_file_system_internals/extension_statuses.html. All methods in this class | 18 // sync_file_system_internals/extension_statuses.html. All methods in this class |
18 // should be called on UI thread. | 19 // should be called on UI thread. |
19 class ExtensionStatusesHandler : public content::WebUIMessageHandler { | 20 class ExtensionStatusesHandler : public content::WebUIMessageHandler { |
20 public: | 21 public: |
21 explicit ExtensionStatusesHandler(Profile* profile); | 22 explicit ExtensionStatusesHandler(Profile* profile); |
22 virtual ~ExtensionStatusesHandler(); | 23 virtual ~ExtensionStatusesHandler(); |
23 | 24 |
24 // Shared by Extension Statuses Tab and also File Metadata Tab to generate the | 25 // Shared by Extension Statuses Tab and also File Metadata Tab to generate the |
25 // extension drop down. | 26 // extension drop down. |
26 static void GetExtensionStatusesAsDictionary(Profile* profile, | 27 static void GetExtensionStatusesAsDictionary( |
27 base::ListValue* values); | 28 Profile* profile, |
| 29 const base::Callback<void(const base::ListValue&)>& callback); |
28 | 30 |
29 // WebUIMessageHandler implementation. | 31 // WebUIMessageHandler implementation. |
30 virtual void RegisterMessages() OVERRIDE; | 32 virtual void RegisterMessages() OVERRIDE; |
31 | 33 |
32 private: | 34 private: |
33 void GetExtensionStatuses(const base::ListValue* args); | 35 void GetExtensionStatuses(const base::ListValue* args); |
| 36 void DidGetExtensionStatuses(const base::ListValue& list); |
34 | 37 |
35 Profile* profile_; | 38 Profile* profile_; |
| 39 base::WeakPtrFactory<ExtensionStatusesHandler> weak_ptr_factory_; |
36 | 40 |
37 DISALLOW_COPY_AND_ASSIGN(ExtensionStatusesHandler); | 41 DISALLOW_COPY_AND_ASSIGN(ExtensionStatusesHandler); |
38 }; | 42 }; |
39 | 43 |
40 } // namespace syncfs_internals | 44 } // namespace syncfs_internals |
41 | 45 |
42 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_EXTENSION_STATUSES
_HANDLER_H_ | 46 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_EXTENSION_STATUSES
_HANDLER_H_ |
OLD | NEW |