OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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_EXTENSIONS_EXTENSION_COMMANDS_HANDLER_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_COMMANDS_HANDLER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/compiler_specific.h" | |
10 #include "content/public/browser/web_ui_message_handler.h" | |
11 | |
12 namespace base { | |
13 class DictionaryValue; | |
14 class ListValue; | |
15 } | |
16 | |
17 namespace extensions { | |
18 class Command; | |
19 class ExtensionCommandService; | |
20 } | |
21 | |
22 class Extension; | |
23 | |
24 namespace extensions { | |
25 | |
26 // The handler page for the Extension Commands UI overlay. | |
27 class ExtensionCommandsHandler : public content::WebUIMessageHandler { | |
28 public: | |
29 ExtensionCommandsHandler(); | |
30 virtual ~ExtensionCommandsHandler(); | |
31 | |
32 // Fetches the localized values for the page and deposits them into | |
33 // |localized_strings|. | |
34 void GetLocalizedValues(base::DictionaryValue* localized_strings); | |
35 | |
36 // WebUIMessageHandler implementation. | |
37 virtual void RegisterMessages() OVERRIDE; | |
38 | |
39 private: | |
40 // Handles requests from javascript to fetch the extensions data, including | |
41 // the commands it contains. | |
42 // Replies back through: ExtensionCommandsOverlay.returnExtensionsData. | |
43 void HandleRequestExtensionsData(const base::ListValue* args); | |
44 | |
45 // Fetches all known commands, active and inactive and returns them through | |
46 // |commands|. | |
47 void GetAllCommands(base::DictionaryValue* commands); | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(ExtensionCommandsHandler); | |
50 }; | |
51 | |
52 } // namespace extensions | |
53 | |
54 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_COMMANDS_HANDLER_H_ | |
OLD | NEW |