| Index: chrome/browser/extensions/extension_function_dispatcher.cc
|
| diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
|
| index 40c5996ba69e32f9c5bd98ac51e9840271d4fd53..95487b2bdf05a220fdec1cbd15e524bb0fc13b38 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_constants;
|
|
|
| // 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,9 @@ ExtensionFunctionDispatcher::ExtensionFunctionDispatcher(
|
| delegate_(delegate),
|
| url_(url),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(peer_(new Peer(this))) {
|
| + DCHECK(url.SchemeIs(chrome::kExtensionScheme));
|
| + // TODO(erikkay) also verify id is valid
|
| +
|
| all_instances()->insert(this);
|
|
|
| // Notify the ExtensionProcessManager that the view was created.
|
| @@ -207,6 +219,11 @@ Browser* ExtensionFunctionDispatcher::GetBrowser() {
|
| return retval;
|
| }
|
|
|
| +ExtensionHost* ExtensionFunctionDispatcher::GetHost() {
|
| + DCHECK(delegate_);
|
| + return delegate_->GetHost();
|
| +}
|
| +
|
| void ExtensionFunctionDispatcher::HandleRequest(const std::string& name,
|
| const std::string& args,
|
| int request_id,
|
|
|