diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-30 20:55:11 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-30 20:55:11 +0000 |
commit | b7dfa34c0f886d7c1f0eb6eaebd02aa85fad3d0e (patch) | |
tree | 2b21bc49f31c3097d8df93867e4d75bc03eb0c9d /chrome/browser/extensions/extensions_ui.h | |
parent | ed007370f3e0362799a2569f09772e8fbe2dd298 (diff) | |
download | chromium_src-b7dfa34c0f886d7c1f0eb6eaebd02aa85fad3d0e.zip chromium_src-b7dfa34c0f886d7c1f0eb6eaebd02aa85fad3d0e.tar.gz chromium_src-b7dfa34c0f886d7c1f0eb6eaebd02aa85fad3d0e.tar.bz2 |
Add a button to chrome://extensions to load an extension.
BUG=20577
TBR=rafaelw@chromium.org
Review URL: http://codereview.chromium.org/177032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24871 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_ui.h')
-rw-r--r-- | chrome/browser/extensions/extensions_ui.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extensions_ui.h b/chrome/browser/extensions/extensions_ui.h index b63b12b..ad99ac5 100644 --- a/chrome/browser/extensions/extensions_ui.h +++ b/chrome/browser/extensions/extensions_ui.h @@ -10,6 +10,9 @@ #include "chrome/browser/dom_ui/chrome_url_data_manager.h" #include "chrome/browser/dom_ui/dom_ui.h" +#include "chrome/browser/shell_dialogs.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" #include "googleurl/src/gurl.h" class DictionaryValue; @@ -46,7 +49,10 @@ class ExtensionsUIHTMLSource : public ChromeURLDataManager::DataSource { }; // The handler for Javascript messages related to the "extensions" view. -class ExtensionsDOMHandler : public DOMMessageHandler { +class ExtensionsDOMHandler + : public DOMMessageHandler, + public NotificationObserver, + public SelectFileDialog::Listener { public: explicit ExtensionsDOMHandler(ExtensionsService* extension_service); virtual ~ExtensionsDOMHandler(); @@ -81,6 +87,23 @@ class ExtensionsDOMHandler : public DOMMessageHandler { // Callback for "uninstall" message. void HandleUninstallMessage(const Value* value); + // Callback for "load" message. + void HandleLoadMessage(const Value* value); + + // SelectFileDialog::Listener + virtual void FileSelected(const FilePath& path, + int index, void* params); + virtual void MultiFilesSelected( + const std::vector<FilePath>& files, void* params) { + NOTREACHED(); + }; + virtual void FileSelectionCanceled(void* params) {}; + + // NotificationObserver + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + // Helper that lists the current active html pages for an extension. std::vector<ExtensionPage> GetActivePagesForExtension( const std::string& extension_id); @@ -88,6 +111,13 @@ class ExtensionsDOMHandler : public DOMMessageHandler { // Our model. scoped_refptr<ExtensionsService> extensions_service_; + // Used to pick the directory when loading an extension. + scoped_refptr<SelectFileDialog> load_extension_dialog_; + + // We monitor changes to the extension system so that we can reload when + // necessary. + NotificationRegistrar registrar_; + DISALLOW_COPY_AND_ASSIGN(ExtensionsDOMHandler); }; |