summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_function_dispatcher.cc
diff options
context:
space:
mode:
authorerikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-01 21:14:05 +0000
committererikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-01 21:14:05 +0000
commit2d5fa0d0a9751c5eb61baefd43760c36233f2d20 (patch)
treeecccdbea7c8553d6efca29c3d9ce4efab02ab6ec /chrome/browser/extensions/extension_function_dispatcher.cc
parent2a464a9638588073f344df55d46da6f9910d892b (diff)
downloadchromium_src-2d5fa0d0a9751c5eb61baefd43760c36233f2d20.zip
chromium_src-2d5fa0d0a9751c5eb61baefd43760c36233f2d20.tar.gz
chromium_src-2d5fa0d0a9751c5eb61baefd43760c36233f2d20.tar.bz2
mole expand/collapse API, callable from a toolstrip for manual operation
Review URL: http://codereview.chromium.org/160276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_function_dispatcher.cc')
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 40c5996..5d03e1f 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -16,10 +16,12 @@
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_tabs_module.h"
#include "chrome/browser/extensions/extension_tabs_module_constants.h"
+#include "chrome/browser/extensions/extension_toolstrip_api.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/common/result_codes.h"
+#include "chrome/common/url_constants.h"
// FactoryRegistry -------------------------------------------------------------
@@ -67,6 +69,7 @@ void FactoryRegistry::ResetFunctions() {
namespace tabs = extension_tabs_module_constants;
namespace page_actions = extension_page_actions_module_constants;
namespace bookmarks = extension_bookmarks_module_constants;
+ namespace toolstrip = extension_toolstrip_api_functions;
// Windows
factories_[tabs::kGetWindowFunction] =
@@ -127,6 +130,12 @@ void FactoryRegistry::ResetFunctions() {
&NewExtensionFunction<MoveBookmarkFunction>;
factories_[bookmarks::kSetBookmarkTitleFunction] =
&NewExtensionFunction<SetBookmarkTitleFunction>;
+
+ // Toolstrips.
+ factories_[toolstrip::kExpandFunction] =
+ &NewExtensionFunction<ToolstripExpandFunction>;
+ factories_[toolstrip::kCollapseFunction] =
+ &NewExtensionFunction<ToolstripCollapseFunction>;
}
void FactoryRegistry::GetAllNames(std::vector<std::string>* names) {
@@ -187,6 +196,10 @@ ExtensionFunctionDispatcher::ExtensionFunctionDispatcher(
delegate_(delegate),
url_(url),
ALLOW_THIS_IN_INITIALIZER_LIST(peer_(new Peer(this))) {
+ // TODO(erikkay) should we do something for these errors in Release?
+ DCHECK(url.SchemeIs(chrome::kExtensionScheme));
+ DCHECK(profile()->GetExtensionsService()->GetExtensionByURL(url));
+
all_instances()->insert(this);
// Notify the ExtensionProcessManager that the view was created.
@@ -207,6 +220,11 @@ Browser* ExtensionFunctionDispatcher::GetBrowser() {
return retval;
}
+ExtensionHost* ExtensionFunctionDispatcher::GetExtensionHost() {
+ DCHECK(delegate_);
+ return delegate_->GetExtensionHost();
+}
+
void ExtensionFunctionDispatcher::HandleRequest(const std::string& name,
const std::string& args,
int request_id,