This is the first part of the PageAction implementation. More work is required, but this is a good checkpoint.
Design doc: http://dev.chromium.org/developers/design-documents/extensions/page-actions-api
This checkin only covers Tab scoped page actions (not type "permanent"). It works end to end (if you have an extension that supplies the page action info -- I created an RSS page action that links to Google Reader).
Please note that TabIndex is hard coded to 0 until the extension system can provide the tab id to the extensions (which I understand is in progress). This means that page action(s) only show up for the first tab in the tabstrip. :)
BUG=None
TEST=There is a unit test for the API, but apart from that it is not possible to test this manually without writing an extension that adds a PageAction. My RSS page action is not ready to be checked in but I can provide it if there is interest in a sneak preview during review/QA.
Review URL: http://codereview.chromium.org/99253
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15105 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 0d45d84e..8843ee8 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -11,6 +11,7 @@
#include "base/values.h"
#include "chrome/browser/extensions/extension_bookmarks_module.h"
#include "chrome/browser/extensions/extension_function.h"
+#include "chrome/browser/extensions/extension_page_actions_module.h"
#include "chrome/browser/extensions/extension_tabs_module.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
@@ -50,7 +51,7 @@
FactoryRegistry::FactoryRegistry() {
// Register all functions here.
- // Tabs
+ // Tabs.
factories_["GetWindows"] = &NewExtensionFunction<GetWindowsFunction>;
factories_["CreateWindow"] = &NewExtensionFunction<CreateWindowFunction>;
factories_["RemoveWindow"] = &NewExtensionFunction<RemoveWindowFunction>;
@@ -62,7 +63,11 @@
factories_["MoveTab"] = &NewExtensionFunction<MoveTabFunction>;
factories_["RemoveTab"] = &NewExtensionFunction<RemoveTabFunction>;
- // Bookmarks
+ // Page Actions.
+ factories_["EnablePageAction"] =
+ &NewExtensionFunction<EnablePageActionFunction>;
+
+ // Bookmarks.
factories_["GetBookmarks"] = &NewExtensionFunction<GetBookmarksFunction>;
factories_["GetBookmarkChildren"] =
&NewExtensionFunction<GetBookmarkChildrenFunction>;