| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_EXTENSIONS_EXTENSIONS_UI_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 public: | 50 public: |
| 51 explicit ExtensionsDOMHandler(ExtensionsService* extension_service); | 51 explicit ExtensionsDOMHandler(ExtensionsService* extension_service); |
| 52 virtual ~ExtensionsDOMHandler(); | 52 virtual ~ExtensionsDOMHandler(); |
| 53 | 53 |
| 54 // DOMMessageHandler implementation. | 54 // DOMMessageHandler implementation. |
| 55 virtual void RegisterMessages(); | 55 virtual void RegisterMessages(); |
| 56 | 56 |
| 57 // Extension Detail JSON Struct for page. (static for ease of testing). | 57 // Extension Detail JSON Struct for page. (static for ease of testing). |
| 58 static DictionaryValue* CreateExtensionDetailValue( | 58 static DictionaryValue* CreateExtensionDetailValue( |
| 59 const Extension *extension, | 59 const Extension *extension, |
| 60 const std::vector<ExtensionPage>&); | 60 const std::vector<ExtensionPage>&, |
| 61 bool enabled); |
| 61 | 62 |
| 62 // ContentScript JSON Struct for page. (static for ease of testing). | 63 // ContentScript JSON Struct for page. (static for ease of testing). |
| 63 static DictionaryValue* CreateContentScriptDetailValue( | 64 static DictionaryValue* CreateContentScriptDetailValue( |
| 64 const UserScript& script, | 65 const UserScript& script, |
| 65 const FilePath& extension_path); | 66 const FilePath& extension_path); |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 // Callback for "requestExtensionsData" message. | 69 // Callback for "requestExtensionsData" message. |
| 69 void HandleRequestExtensionsData(const Value* value); | 70 void HandleRequestExtensionsData(const Value* value); |
| 70 | 71 |
| 71 // Callback for "inspect" message. | 72 // Callback for "inspect" message. |
| 72 void HandleInspectMessage(const Value* value); | 73 void HandleInspectMessage(const Value* value); |
| 73 | 74 |
| 74 // Callback for "reload" message. | 75 // Callback for "reload" message. |
| 75 void HandleReloadMessage(const Value* value); | 76 void HandleReloadMessage(const Value* value); |
| 76 | 77 |
| 78 // Callback for "enable" message. |
| 79 void HandleEnableMessage(const Value* value); |
| 80 |
| 77 // Callback for "uninstall" message. | 81 // Callback for "uninstall" message. |
| 78 void HandleUninstallMessage(const Value* value); | 82 void HandleUninstallMessage(const Value* value); |
| 79 | 83 |
| 80 // Helper that lists the current active html pages for an extension. | 84 // Helper that lists the current active html pages for an extension. |
| 81 std::vector<ExtensionPage> GetActivePagesForExtension( | 85 std::vector<ExtensionPage> GetActivePagesForExtension( |
| 82 const std::string& extension_id); | 86 const std::string& extension_id); |
| 83 | 87 |
| 84 // Our model. | 88 // Our model. |
| 85 scoped_refptr<ExtensionsService> extensions_service_; | 89 scoped_refptr<ExtensionsService> extensions_service_; |
| 86 | 90 |
| 87 DISALLOW_COPY_AND_ASSIGN(ExtensionsDOMHandler); | 91 DISALLOW_COPY_AND_ASSIGN(ExtensionsDOMHandler); |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 class ExtensionsUI : public DOMUI { | 94 class ExtensionsUI : public DOMUI { |
| 91 public: | 95 public: |
| 92 explicit ExtensionsUI(TabContents* contents); | 96 explicit ExtensionsUI(TabContents* contents); |
| 93 | 97 |
| 94 private: | 98 private: |
| 95 DISALLOW_COPY_AND_ASSIGN(ExtensionsUI); | 99 DISALLOW_COPY_AND_ASSIGN(ExtensionsUI); |
| 96 }; | 100 }; |
| 97 | 101 |
| 98 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ | 102 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ |
| OLD | NEW |