diff options
| author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-28 19:56:51 +0000 |
|---|---|---|
| committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-28 19:56:51 +0000 |
| commit | 703e807a70e50e32b3c4821c84c23bde69f73272 (patch) | |
| tree | 615d9f7d150e5ec51821a892eecc8ebdb269b447 /chrome/browser | |
| parent | a137bdac37451b1b218cf4c43a798aa3abd4c875 (diff) | |
| download | chromium_src-703e807a70e50e32b3c4821c84c23bde69f73272.zip chromium_src-703e807a70e50e32b3c4821c84c23bde69f73272.tar.gz chromium_src-703e807a70e50e32b3c4821c84c23bde69f73272.tar.bz2 | |
Add more of the server-side plumbing for extension APIs. Also
added getTabsForWindow() to drive it.
Review URL: http://codereview.chromium.org/42680
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12744 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
| -rw-r--r-- | chrome/browser/browser.scons | 13 | ||||
| -rw-r--r-- | chrome/browser/browser.vcproj | 28 | ||||
| -rw-r--r-- | chrome/browser/extensions/extension_api_handler.cc | 45 | ||||
| -rw-r--r-- | chrome/browser/extensions/extension_api_handler.h | 29 | ||||
| -rw-r--r-- | chrome/browser/extensions/extension_function.cc | 16 | ||||
| -rw-r--r-- | chrome/browser/extensions/extension_function.h | 81 | ||||
| -rw-r--r-- | chrome/browser/extensions/extension_function_dispatcher.cc | 115 | ||||
| -rw-r--r-- | chrome/browser/extensions/extension_function_dispatcher.h | 37 | ||||
| -rw-r--r-- | chrome/browser/extensions/extension_tabs_module.cc | 79 | ||||
| -rw-r--r-- | chrome/browser/extensions/extension_tabs_module.h | 17 | ||||
| -rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 9 | ||||
| -rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.h | 4 | ||||
| -rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 4 | ||||
| -rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 7 |
14 files changed, 394 insertions, 90 deletions
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index fa9dba8..e9931dc 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -506,15 +506,19 @@ input_files = ChromeFileList([ MSVSFilter('Extensions', [ 'extensions/extension.cc', 'extensions/extension.h', - 'extensions/extension_api_handler.cc', - 'extensions/extension_api_handler.h', - 'extensions/extension_view.cc', - 'extensions/extension_view.h', + 'extensions/extension_function.cc', + 'extensions/extension_function.h', + 'extensions/extension_function_dispatcher.cc', + 'extensions/extension_function_dispatcher.h', 'extensions/extension_error_reporter.cc', 'extensions/extension_error_reporter.h', 'extensions/extension_message_service.cc', 'extensions/extension_message_service.h', 'extensions/extension_protocols.h', + 'extensions/extension_tabs_module.cc', + 'extensions/extension_tabs_module.h', + 'extensions/extension_view.cc', + 'extensions/extension_view.h', 'extensions/extensions_service.cc', 'extensions/extensions_service.h', 'extensions/extensions_ui.cc', @@ -530,6 +534,7 @@ input_files = ChromeFileList([ 'renderer_host/backing_store.h', 'renderer_host/backing_store.cc', 'renderer_host/backing_store_win.cc', + 'renderer_host/backing_store_win.cc', 'renderer_host/browser_render_process_host.cc', 'renderer_host/browser_render_process_host.h', 'renderer_host/buffered_resource_handler.cc', diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index ff76afb..63934d7 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -822,11 +822,11 @@ > </File> <File - RelativePath=".\automation\automation_provider_list_generic.cc" + RelativePath=".\automation\automation_provider_list.h" > </File> <File - RelativePath=".\automation\automation_provider_list.h" + RelativePath=".\automation\automation_provider_list_generic.cc" > </File> <File @@ -1906,19 +1906,27 @@ > </File> <File - RelativePath=".\extensions\extension_api_handler.cc" + RelativePath=".\extensions\extension_error_reporter.cc" > </File> <File - RelativePath=".\extensions\extension_api_handler.h" + RelativePath=".\extensions\extension_error_reporter.h" > </File> <File - RelativePath=".\extensions\extension_error_reporter.cc" + RelativePath=".\extensions\extension_function.cc" > </File> <File - RelativePath=".\extensions\extension_error_reporter.h" + RelativePath=".\extensions\extension_function.h" + > + </File> + <File + RelativePath=".\extensions\extension_function_dispatcher.cc" + > + </File> + <File + RelativePath=".\extensions\extension_function_dispatcher.h" > </File> <File @@ -1938,6 +1946,14 @@ > </File> <File + RelativePath=".\extensions\extension_tabs_module.cc" + > + </File> + <File + RelativePath=".\extensions\extension_tabs_module.h" + > + </File> + <File RelativePath=".\extensions\extension_view.cc" > </File> diff --git a/chrome/browser/extensions/extension_api_handler.cc b/chrome/browser/extensions/extension_api_handler.cc deleted file mode 100644 index 702917b..0000000 --- a/chrome/browser/extensions/extension_api_handler.cc +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/extensions/extension_api_handler.h" - -#include "base/json_reader.h" -#include "base/json_writer.h" -#include "base/values.h" -#include "chrome/browser/browser.h" -#include "chrome/browser/browser_list.h" -#include "chrome/browser/renderer_host/render_view_host.h" - -ExtensionAPIHandler::ExtensionAPIHandler(RenderViewHost* render_view_host) - : render_view_host_(render_view_host) {} - -void ExtensionAPIHandler::HandleRequest(const std::string& name, - const std::string& args, - int callback_id) { - scoped_ptr<Value> value; - if (!args.empty()) { - value.reset(JSONReader::Read(args, false)); - DCHECK(value.get()); - } - - // TODO(aa): This will probably dispatch to per-module specialized classes. - // Consider refactoring similar work in dom_ui to reuse. - if (name == "CreateTab") { - Browser* browser = BrowserList::GetLastActive(); - if (browser) { - DCHECK(value->IsType(Value::TYPE_DICTIONARY)); - std::string url; - static_cast<DictionaryValue*>(value.get())->GetString(L"url", &url); - browser->AddTabWithURL(GURL(url), GURL(), PageTransition::TYPED, true, - NULL); - - static int response_count = 0; - scoped_ptr<Value> response(Value::CreateIntegerValue(response_count++)); - std::string json; - JSONWriter::Write(response.get(), false, &json); - - render_view_host_->SendExtensionResponse(callback_id, json); - } - } -} diff --git a/chrome/browser/extensions/extension_api_handler.h b/chrome/browser/extensions/extension_api_handler.h deleted file mode 100644 index 3cd6efd..0000000 --- a/chrome/browser/extensions/extension_api_handler.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_APIS_H_ -#define CHROME_BROWSER_EXTENSIONS_EXTENSION_APIS_H_ - -#include <string> - -class RenderViewHost; - -// ExtensionAPIHandler is the top-level entry point for extension callbacks -// in the browser process. It lives on the UI thread. -class ExtensionAPIHandler { - public: - ExtensionAPIHandler(RenderViewHost* render_view_host); - - // Handle a request to perform some synchronous API. - // TODO(aa): args should be a Value object. - void HandleRequest(const std::string& name, const std::string& args, - int callback_id); - - private: - // TODO(aa): Once there can be APIs that are asynchronous wrt the browser's UI - // thread, we may have to have to do something about this raw pointer. - RenderViewHost* render_view_host_; -}; - -#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APIS_H_ diff --git a/chrome/browser/extensions/extension_function.cc b/chrome/browser/extensions/extension_function.cc new file mode 100644 index 0000000..8eb562f --- /dev/null +++ b/chrome/browser/extensions/extension_function.cc @@ -0,0 +1,16 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/extension_function.h" + +#include "chrome/browser/extensions/extension_function_dispatcher.h" + +void ExtensionFunction::SendResponse(bool success) { + if (success) { + dispatcher_->SendResponse(this); + } else { + // TODO(aa): In case of failure, send the error message to an error + // callback. + } +} diff --git a/chrome/browser/extensions/extension_function.h b/chrome/browser/extensions/extension_function.h new file mode 100644 index 0000000..421df81 --- /dev/null +++ b/chrome/browser/extensions/extension_function.h @@ -0,0 +1,81 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ + +#include <string> + +#include "base/values.h" +#include "base/scoped_ptr.h" + +class ExtensionFunctionDispatcher; + +// Base class for an extension function. +// TODO(aa): This will have to become reference counted when we introduce APIs +// that live beyond a single stack frame. +class ExtensionFunction { + public: + virtual ~ExtensionFunction() {} + + void set_dispatcher(ExtensionFunctionDispatcher* dispatcher) { + dispatcher_ = dispatcher; + } + void set_args(Value* args) { args_ = args; } + + void set_callback_id(int callback_id) { callback_id_ = callback_id; } + int callback_id() { return callback_id_; } + + Value* result() { return result_.get(); } + const std::string& error() { return error_; } + + // Whether the extension has registered a callback and is waiting for a + // response. APIs can use this to avoid doing unnecessary work in the case + // that the extension is not expecting a response. + bool has_callback() { return callback_id_ != -1; } + + // Execute the API. Clients should call set_args() and set_callback_id() + // before calling this method. Derived classes should populate result_ and + // error_ before returning. + virtual void Run() = 0; + + protected: + void SendResponse(bool success); + + // The arguments to the API. Only non-null if argument were specfied. + Value* args_; + + // The result of the API. This should be populated by the derived class before + // Run() returns. + scoped_ptr<Value> result_; + + // Any detailed error from the API. This should be populated by the derived + // class before Run() returns. + std::string error_; + + private: + ExtensionFunctionDispatcher* dispatcher_; + int callback_id_; +}; + + +// A SyncExtensionFunction is an ExtensionFunction that runs synchronously +// *relative to the browser's UI thread*. Note that this has nothing to do with +// running synchronously relative to the extension process. From the extension +// process's point of view, the function is still asynchronous. +// +// This kind of function is convenient for implementing simple APIs that just +// need to interact with things on the browser UI thread. +class SyncExtensionFunction : public ExtensionFunction { + public: + // Derived classes should implement this method to do their work and return + // success/failure. + virtual bool RunImpl() = 0; + + virtual void Run() { + SendResponse(RunImpl()); + } +}; + +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc new file mode 100644 index 0000000..f1f1379 --- /dev/null +++ b/chrome/browser/extensions/extension_function_dispatcher.cc @@ -0,0 +1,115 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/extension_function_dispatcher.h" + +#include "base/json_reader.h" +#include "base/json_writer.h" +#include "base/singleton.h" +#include "base/values.h" +#include "chrome/browser/extensions/extension_function.h" +#include "chrome/browser/extensions/extension_tabs_module.h" +#include "chrome/browser/renderer_host/render_view_host.h" + +// FactoryRegistry ------------------------------------------------------------- + +namespace { + +// A pointer to a function that create an instance of an ExtensionFunction. +typedef ExtensionFunction* (*ExtensionFunctionFactory)(); + +// Contains a list of all known extension functions and allows clients to create +// instances of them. +class FactoryRegistry { + public: + static FactoryRegistry* instance(); + FactoryRegistry(); + void GetAllNames(std::vector<std::string>* names); + ExtensionFunction* NewFunction(const std::string& name); + + private: + typedef std::map<std::string, ExtensionFunctionFactory> FactoryMap; + FactoryMap factories_; +}; + +// Template for defining ExtensionFunctionFactory. +template<class T> +ExtensionFunction* NewExtensionFunction() { + return new T(); +} + +FactoryRegistry* FactoryRegistry::instance() { + return Singleton<FactoryRegistry>::get(); +} + +FactoryRegistry::FactoryRegistry() { + // Register all functions here. + factories_["GetTabsForWindow"] = + &NewExtensionFunction<GetTabsForWindowFunction>; + factories_["CreateTab"] = &NewExtensionFunction<CreateTabFunction>; +} + +void FactoryRegistry::GetAllNames( + std::vector<std::string>* names) { + for (FactoryMap::iterator iter = factories_.begin(); iter != factories_.end(); + ++iter) { + names->push_back(iter->first); + } +} + +ExtensionFunction* FactoryRegistry::NewFunction(const std::string& name) { + FactoryMap::iterator iter = factories_.find(name); + DCHECK(iter != factories_.end()); + return iter->second(); +} + +}; + + +// ExtensionFunctionDispatcher ------------------------------------------------- + +void ExtensionFunctionDispatcher::GetAllFunctionNames( + std::vector<std::string>* names) { + FactoryRegistry::instance()->GetAllNames(names); +} + +ExtensionFunctionDispatcher::ExtensionFunctionDispatcher( + RenderViewHost* render_view_host) + : render_view_host_(render_view_host) {} + +void ExtensionFunctionDispatcher::HandleRequest(const std::string& name, + const std::string& args, + int callback_id) { + scoped_ptr<Value> value; + if (!args.empty()) { + JSONReader reader; + value.reset(reader.JsonToValue(args, false, false)); + + // Since we do the serialization in the v8 extension, we should always get + // valid JSON. + if (!value.get()) { + DCHECK(false); + return; + } + } + + // TODO(aa): This will get a bit more complicated when we support functions + // that live longer than the stack frame. + scoped_ptr<ExtensionFunction> function( + FactoryRegistry::instance()->NewFunction(name)); + function->set_dispatcher(this); + function->set_args(value.get()); + function->set_callback_id(callback_id); + function->Run(); +} + +void ExtensionFunctionDispatcher::SendResponse(ExtensionFunction* function) { + std::string json; + + // Some functions might not need to return any results. + if (function->result()) + JSONWriter::Write(function->result(), false, &json); + + render_view_host_->SendExtensionResponse(function->callback_id(), json); +} diff --git a/chrome/browser/extensions/extension_function_dispatcher.h b/chrome/browser/extensions/extension_function_dispatcher.h new file mode 100644 index 0000000..2b9c49e --- /dev/null +++ b/chrome/browser/extensions/extension_function_dispatcher.h @@ -0,0 +1,37 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ + +#include <string> +#include <vector> + +#include "base/values.h" + +class ExtensionFunction; +class RenderViewHost; + +// ExtensionFunctionDispatcher receives requests to execute functions from +// Chromium extensions running in a RenderViewHost and dispatches them to the +// appropriate handler. It lives entirely on the UI thread. +class ExtensionFunctionDispatcher { + public: + // Gets a list of all known extension function names. + static void GetAllFunctionNames(std::vector<std::string>* names); + + ExtensionFunctionDispatcher(RenderViewHost* render_view_host); + + // Handle a request to execute an extension function. + void HandleRequest(const std::string& name, const std::string& args, + int callback_id); + + // Send a response to a function. + void SendResponse(ExtensionFunction* api); + + private: + RenderViewHost* render_view_host_; +}; + +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc new file mode 100644 index 0000000..8568b43 --- /dev/null +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -0,0 +1,79 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/extension_tabs_module.h" + +#include "base/string_util.h" +#include "chrome/browser/browser.h" +#include "chrome/browser/browser_list.h" +#include "chrome/browser/extensions/extension_function_dispatcher.h" +#include "chrome/browser/tab_contents/navigation_entry.h" + +// Forward declare static helper functions defined below. +static DictionaryValue* CreateTabValue(TabStripModel* tab_strip_model, + int tab_index); + +bool GetTabsForWindowFunction::RunImpl() { + if (!args_->IsType(Value::TYPE_NULL)) + return false; + + Browser* browser = BrowserList::GetLastActive(); + if (!browser) + return false; + + TabStripModel* tab_strip = browser->tabstrip_model(); + result_.reset(new ListValue()); + for (int i = 0; i < tab_strip->count(); ++i) { + static_cast<ListValue*>(result_.get())->Append( + CreateTabValue(tab_strip, i)); + } + + return true; +} + +bool CreateTabFunction::RunImpl() { + // TODO(aa): Do data-driven validation in JS. + if (!args_->IsType(Value::TYPE_DICTIONARY)) + return false; + + Browser* browser = BrowserList::GetLastActive(); + if (!browser) + return false; + + // TODO(aa): Handle all the other properties of the new tab. + std::string url; + static_cast<const DictionaryValue*>(args_)->GetString(L"url", &url); + browser->AddTabWithURL(GURL(url), GURL(), PageTransition::TYPED, true, NULL); + + // Return data about the newly created tab. + if (has_callback()) + result_.reset(CreateTabValue(browser->tabstrip_model(), + browser->tabstrip_model()->count() - 1)); + + return true; +} + + +// static helpers +static DictionaryValue* CreateTabValue(TabStripModel* tab_strip, + int tab_index) { + TabContents* contents = tab_strip->GetTabContentsAt(tab_index); + NavigationController* controller = contents->controller(); + DCHECK(controller); // TODO(aa): Is this a valid assumption? + + DictionaryValue* result = new DictionaryValue(); + result->SetInteger(L"id", controller->session_id().id()); + result->SetInteger(L"windowId", controller->window_id().id()); + result->SetString(L"url", contents->GetURL().spec()); + result->SetString(L"title", UTF16ToWide(contents->GetTitle())); + result->SetBoolean(L"selected", tab_index == tab_strip->selected_index()); + + NavigationEntry* entry = controller->GetActiveEntry(); + if (entry) { + if (entry->favicon().is_valid()) + result->SetString(L"favIconUrl", entry->favicon().url().spec()); + } + + return result; +} diff --git a/chrome/browser/extensions/extension_tabs_module.h b/chrome/browser/extensions/extension_tabs_module.h new file mode 100644 index 0000000..6dfffa5 --- /dev/null +++ b/chrome/browser/extensions/extension_tabs_module.h @@ -0,0 +1,17 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ + +#include "chrome/browser/extensions/extension_function.h" + +class GetTabsForWindowFunction : public SyncExtensionFunction { + virtual bool RunImpl(); +}; +class CreateTabFunction : public SyncExtensionFunction { + virtual bool RunImpl(); +}; + +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 4d6d917..af974f5 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -346,6 +346,7 @@ bool BrowserRenderProcessHost::Init() { InitVisitedLinks(); InitUserScripts(); + InitExtensions(); if (max_page_id_ != -1) channel_->Send(new ViewMsg_SetNextPageID(max_page_id_ + 1)); @@ -448,6 +449,14 @@ void BrowserRenderProcessHost::InitUserScripts() { SendUserScriptsUpdate(user_script_master->GetSharedMemory()); } +void BrowserRenderProcessHost::InitExtensions() { + // TODO(aa): Should only bother sending these function names if this is an + // extension process. + std::vector<std::string> function_names; + ExtensionFunctionDispatcher::GetAllFunctionNames(&function_names); + Send(new ViewMsg_Extension_SetFunctionNames(function_names)); +} + void BrowserRenderProcessHost::SendUserScriptsUpdate( base::SharedMemory *shared_memory) { base::SharedMemoryHandle handle_for_process; diff --git a/chrome/browser/renderer_host/browser_render_process_host.h b/chrome/browser/renderer_host/browser_render_process_host.h index d6f821e..c6517b8 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.h +++ b/chrome/browser/renderer_host/browser_render_process_host.h @@ -109,6 +109,10 @@ class BrowserRenderProcessHost : public RenderProcessHost, // set of scripts and listen for updates to scripts. void InitUserScripts(); + // Initialize support for extension APIs. Send the list of registered API + // functions to thre renderer process. + void InitExtensions(); + // Sends the renderer process a new set of user scripts. void SendUserScriptsUpdate(base::SharedMemory* shared_memory); diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 35582d4..8222ec3 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -100,7 +100,7 @@ RenderViewHost::RenderViewHost(SiteInstance* instance, has_unload_listener_(false), is_waiting_for_unload_ack_(false), are_javascript_messages_suppressed_(false), - ALLOW_THIS_IN_INITIALIZER_LIST(extension_api_handler_(this)) { + ALLOW_THIS_IN_INITIALIZER_LIST(extension_function_dispatcher_(this)) { DCHECK(instance_); DCHECK(delegate_); if (modal_dialog_event == NULL) @@ -1354,7 +1354,7 @@ void RenderViewHost::OnExtensionRequest(const std::string& name, int callback_id) { // TODO(aa): Here is where we can check that this renderer was supposed to be // able to call extension APIs. - extension_api_handler_.HandleRequest(name, args, callback_id); + extension_function_dispatcher_.HandleRequest(name, args, callback_id); } void RenderViewHost::SendExtensionResponse(int callback_id, diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 3142c6c..718c585 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -9,7 +9,7 @@ #include <vector> #include "base/scoped_ptr.h" -#include "chrome/browser/extensions/extension_api_handler.h" +#include "chrome/browser/extensions/extension_function_dispatcher.h" #include "chrome/browser/renderer_host/render_view_host_delegate.h" #include "chrome/browser/renderer_host/render_widget_host.h" #include "chrome/common/modal_dialog_event.h" @@ -641,9 +641,8 @@ class RenderViewHost : public RenderWidgetHost { bool are_javascript_messages_suppressed_; - // Handler for extension API requests. - // Handles processing IPC messages related to the extension system. - ExtensionAPIHandler extension_api_handler_; + // Handles processing IPC messages request extension functions be executed. + ExtensionFunctionDispatcher extension_function_dispatcher_; DISALLOW_EVIL_CONSTRUCTORS(RenderViewHost); }; |
