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