summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 03:18:46 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 03:18:46 +0000
commit671e6c1cecf01e46dc0267e020971aa0f98de0a2 (patch)
tree61db92254d4030103b4f4f68b7b8a7ad342f6d93 /chrome/common
parent37e1bb64e696f39acb8a80021af58356af8e3bf1 (diff)
downloadchromium_src-671e6c1cecf01e46dc0267e020971aa0f98de0a2.zip
chromium_src-671e6c1cecf01e46dc0267e020971aa0f98de0a2.tar.gz
chromium_src-671e6c1cecf01e46dc0267e020971aa0f98de0a2.tar.bz2
Implement Browser Actions extensions.
Browser Actions are like Page Actions, except they appear next to the Omnibox and are always visible. For details see http://code.google.com/p/chromium/wiki/BrowserActions. Added a simple browser action sample that adds a Print button to the chrome toolbar (which brings up the Print dialog for the current page). Removed |type| from PageActions, which is currently ignored and was already removed from the docs. Each extension can only have 1 browser_action. Each browser action can specify more than one icon, but only the first is used. And no API has been added yet (besides the event definition). BUG=22099 TEST=Install the sample browser action, navigate to google.com, press the print button. A print dialog should come up. Review URL: http://codereview.chromium.org/243001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27319 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/extension.cc93
-rw-r--r--chrome/common/extensions/extension.h28
-rw-r--r--chrome/common/extensions/extension_constants.cc3
-rw-r--r--chrome/common/extensions/extension_constants.h2
-rw-r--r--chrome/common/extensions/extension_unittest.cc119
-rw-r--r--chrome/common/page_action.cc6
-rw-r--r--chrome/common/page_action.h39
7 files changed, 181 insertions, 109 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 3a73bf2..d68e91f 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -10,6 +10,7 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/string_util.h"
+#include "base/stl_util-inl.h"
#include "base/third_party/nss/blapi.h"
#include "base/third_party/nss/sha256.h"
#include "chrome/common/chrome_constants.h"
@@ -106,9 +107,7 @@ const size_t Extension::kNumPermissions =
arraysize(Extension::kPermissionNames);
Extension::~Extension() {
- for (PageActionMap::iterator i = page_actions_.begin();
- i != page_actions_.end(); ++i)
- delete i->second;
+ STLDeleteValues(&page_actions_);
}
const std::string Extension::VersionString() const {
@@ -150,12 +149,18 @@ GURL Extension::GetResourceURL(const GURL& extension_url,
return ret_val;
}
-const PageAction* Extension::GetPageAction(std::string id) const {
- PageActionMap::const_iterator it = page_actions_.find(id);
- if (it == page_actions_.end())
- return NULL;
+const ContextualAction* Extension::GetContextualAction(
+ std::string id, ContextualAction::ContextualActionType action_type) const {
+ if (action_type == ContextualAction::BROWSER_ACTION) {
+ DCHECK(id.empty()); // Multiple browser actions are not allowed.
+ return browser_action_.get();
+ } else {
+ ContextualActionMap::const_iterator it = page_actions_.find(id);
+ if (it == page_actions_.end())
+ return NULL;
- return it->second;
+ return it->second;
+ }
}
Extension::Location Extension::ExternalExtensionInstallType(
@@ -306,13 +311,14 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script,
return true;
}
-// Helper method that loads a PageAction object from a dictionary in the
-// page_action list of the manifest.
-PageAction* Extension::LoadPageActionHelper(
+// Helper method that loads a PageAction or BrowserAction object from a
+// dictionary in the page_actions list or browser_action key of the manifest.
+ContextualAction* Extension::LoadContextualActionHelper(
const DictionaryValue* page_action, int definition_index,
- std::string* error) {
- scoped_ptr<PageAction> result(new PageAction());
+ std::string* error, ContextualAction::ContextualActionType action_type) {
+ scoped_ptr<ContextualAction> result(new ContextualAction());
result->set_extension_id(id());
+ result->set_type(action_type);
ListValue* icons;
// Read the page action |icons|.
@@ -339,14 +345,18 @@ PageAction* Extension::LoadPageActionHelper(
++icon_count;
}
- // Read the page action |id|.
- std::string id;
- if (!page_action->GetString(keys::kPageActionId, &id)) {
- *error = ExtensionErrorUtils::FormatErrorMessage(
- errors::kInvalidPageActionId, IntToString(definition_index));
- return NULL;
+ if (action_type == ContextualAction::BROWSER_ACTION) {
+ result->set_id(""); // Not needed (only 1 browser action per extension).
+ } else {
+ // Read the page action |id|.
+ std::string id;
+ if (!page_action->GetString(keys::kPageActionId, &id)) {
+ *error = ExtensionErrorUtils::FormatErrorMessage(
+ errors::kInvalidPageActionId, IntToString(definition_index));
+ return NULL;
+ }
+ result->set_id(id);
}
- result->set_id(id);
// Read the page action |name|.
std::string name;
@@ -357,23 +367,6 @@ PageAction* Extension::LoadPageActionHelper(
}
result->set_name(name);
- // Read the page action |type|. It is optional and set to permanent if
- // missing.
- std::string type;
- if (!page_action->GetString(keys::kType, &type)) {
- result->set_type(PageAction::PERMANENT);
- } else if (!LowerCaseEqualsASCII(type, values::kPageActionTypeTab) &&
- !LowerCaseEqualsASCII(type, values::kPageActionTypePermanent)) {
- *error = ExtensionErrorUtils::FormatErrorMessage(
- errors::kInvalidPageActionTypeValue, IntToString(definition_index));
- return NULL;
- } else {
- if (LowerCaseEqualsASCII(type, values::kPageActionTypeTab))
- result->set_type(PageAction::TAB);
- else
- result->set_type(PageAction::PERMANENT);
- }
-
return result.release();
}
@@ -940,12 +933,28 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_id,
return false;
}
- PageAction* page_action =
- LoadPageActionHelper(page_action_value, i, error);
- if (!page_action)
+ ContextualAction* contextual_action =
+ LoadContextualActionHelper(page_action_value, i, error,
+ ContextualAction::PAGE_ACTION);
+ if (!contextual_action)
return false; // Failed to parse page action definition.
- page_actions_[page_action->id()] = page_action;
+ page_actions_[contextual_action->id()] = contextual_action;
+ }
+ }
+
+ if (source.HasKey(keys::kBrowserAction)) {
+ DictionaryValue* browser_action_value;
+ if (!source.GetDictionary(keys::kBrowserAction, &browser_action_value)) {
+ *error = ExtensionErrorUtils::FormatErrorMessage(
+ errors::kInvalidBrowserAction, "");
+ return false;
}
+
+ browser_action_.reset(
+ LoadContextualActionHelper(browser_action_value, 0, error,
+ ContextualAction::BROWSER_ACTION));
+ if (!browser_action_.get())
+ return false; // Failed to parse browser action definition.
}
// Initialize the permissions (optional).
@@ -1051,7 +1060,7 @@ std::set<FilePath> Extension::GetBrowserImages() {
}
// page action icons
- for (PageActionMap::const_iterator it = page_actions().begin();
+ for (ContextualActionMap::const_iterator it = page_actions().begin();
it != page_actions().end(); ++it) {
const std::vector<std::string>& icon_paths = it->second->icon_paths();
for (std::vector<std::string>::const_iterator iter = icon_paths.begin();
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index eb7b86c..5589500 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -107,7 +107,8 @@ class Extension {
static const char kMimeType[];
Extension()
- : location_(INVALID), is_theme_(false), background_page_ready_(false) {}
+ : location_(INVALID), is_theme_(false),
+ background_page_ready_(false) {}
explicit Extension(const FilePath& path);
virtual ~Extension();
@@ -193,7 +194,8 @@ class Extension {
const std::string& public_key() const { return public_key_; }
const std::string& description() const { return description_; }
const UserScriptList& content_scripts() const { return content_scripts_; }
- const PageActionMap& page_actions() const { return page_actions_; }
+ const ContextualActionMap& page_actions() const { return page_actions_; }
+ ContextualAction* browser_action() const { return browser_action_.get(); }
const std::vector<PrivacyBlacklistInfo>& privacy_blacklists() const {
return privacy_blacklists_;
}
@@ -224,8 +226,9 @@ class Extension {
const GURL& update_url() const { return update_url_; }
const std::map<int, std::string>& icons() { return icons_; }
- // Retrieves a page action by |id|.
- const PageAction* GetPageAction(std::string id) const;
+ // Retrieves a page action or browser action by |id|.
+ const ContextualAction* GetContextualAction(
+ std::string id, ContextualAction::ContextualActionType action_type) const;
// Returns the origin of this extension. This function takes a |registry_path|
// so that the registry location can be overwritten during testing.
@@ -290,11 +293,13 @@ class Extension {
std::string* error,
UserScript* result);
- // Helper method that loads a PageAction object from a
- // dictionary in the page_action list of the manifest.
- PageAction* LoadPageActionHelper(const DictionaryValue* page_action,
- int definition_index,
- std::string* error);
+ // Helper method that loads a ContextualAction object from a
+ // dictionary in the page_action or browser_action section of the manifest.
+ ContextualAction* LoadContextualActionHelper(
+ const DictionaryValue* contextual_action,
+ int definition_index,
+ std::string* error,
+ ContextualAction::ContextualActionType action_type);
// Figures out if a source contains keys not associated with themes - we
// don't want to allow scripts and such to be bundled with themes.
@@ -330,7 +335,10 @@ class Extension {
UserScriptList content_scripts_;
// A list of page actions.
- PageActionMap page_actions_;
+ ContextualActionMap page_actions_;
+
+ // The extension's browser action, if any.
+ scoped_ptr<ContextualAction> browser_action_;
// Optional list of privacy blacklistrom.
std::vector<PrivacyBlacklistInfo> privacy_blacklists_;
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index 0ae5ff5..8281d42 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -7,6 +7,7 @@
namespace extension_manifest_keys {
const wchar_t* kBackground = L"background_page";
+const wchar_t* kBrowserAction = L"browser_action";
const wchar_t* kChromeURLOverrides = L"chrome_url_overrides";
const wchar_t* kContentScripts = L"content_scripts";
const wchar_t* kCss = L"css";
@@ -53,6 +54,8 @@ const char* kPageActionTypePermanent = "permanent";
// printf because we want to unit test them and scanf is hard to make
// cross-platform.
namespace extension_manifest_errors {
+const char* kInvalidBrowserAction =
+ "Invalid value for 'browser_action'.";
const char* kInvalidChromeURLOverrides =
"Invalid value for 'chrome_url_overrides'.";
const char* kInvalidContentScript =
diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h
index 399315e8..8b321b6 100644
--- a/chrome/common/extensions/extension_constants.h
+++ b/chrome/common/extensions/extension_constants.h
@@ -8,6 +8,7 @@
// Keys used in JSON representation of extensions.
namespace extension_manifest_keys {
extern const wchar_t* kBackground;
+ extern const wchar_t* kBrowserAction;
extern const wchar_t* kChromeURLOverrides;
extern const wchar_t* kContentScripts;
extern const wchar_t* kCss;
@@ -52,6 +53,7 @@ namespace extension_manifest_values {
// Error messages returned from Extension::InitFromValue().
namespace extension_manifest_errors {
+ extern const char* kInvalidBrowserAction;
extern const char* kInvalidChromeURLOverrides;
extern const char* kInvalidContentScript;
extern const char* kInvalidContentScriptsList;
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index f1ee5e1..6348315 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -279,21 +279,28 @@ TEST(ExtensionTest, GetResourceURLAndPath) {
TEST(ExtensionTest, LoadPageActionHelper) {
Extension extension;
std::string error_msg;
- scoped_ptr<PageAction> page_action;
+ scoped_ptr<ContextualAction> action;
DictionaryValue input;
// First try with an empty dictionary. We should get nothing back.
- ASSERT_EQ(NULL, extension.LoadPageActionHelper(&input, 0, &error_msg));
+ ASSERT_EQ(NULL, extension.LoadContextualActionHelper(
+ &input, 0, &error_msg, ContextualAction::PAGE_ACTION));
+ ASSERT_STRNE("", error_msg.c_str());
+ error_msg = "";
+
+ // Now try the same, but as a browser action. Ensure same results.
+ ASSERT_EQ(NULL, extension.LoadContextualActionHelper(
+ &input, 0, &error_msg, ContextualAction::BROWSER_ACTION));
ASSERT_STRNE("", error_msg.c_str());
error_msg = "";
// Now setup some values to use in the page action.
- const std::string id("MyPageActionId");
- const std::string name("MyPageActionName");
+ const std::string id("MyContextualActionId");
+ const std::string name("MyContextualActionName");
std::string img1("image1.png");
std::string img2("image2.png");
- // Add the page_actions dictionary.
+ // Add the dictionary for the contextual action.
input.SetString(keys::kPageActionId, id);
input.SetString(keys::kName, name);
ListValue* icons = new ListValue;
@@ -301,31 +308,46 @@ TEST(ExtensionTest, LoadPageActionHelper) {
icons->Set(1, Value::CreateStringValue(img2));
input.Set(keys::kPageActionIcons, icons);
- // Parse the page action and read back the values from the object.
- page_action.reset(extension.LoadPageActionHelper(&input, 0, &error_msg));
- ASSERT_TRUE(NULL != page_action.get());
+ // Parse as page action and read back the values from the object.
+ action.reset(extension.LoadContextualActionHelper(
+ &input, 0, &error_msg, ContextualAction::PAGE_ACTION));
+ ASSERT_TRUE(NULL != action.get());
ASSERT_STREQ("", error_msg.c_str());
- ASSERT_STREQ(id.c_str(), page_action->id().c_str());
- ASSERT_STREQ(name.c_str(), page_action->name().c_str());
- ASSERT_EQ(2u, page_action->icon_paths().size());
- ASSERT_STREQ(img1.c_str(), page_action->icon_paths()[0].c_str());
- ASSERT_STREQ(img2.c_str(), page_action->icon_paths()[1].c_str());
- // Type hasn't been set, but it defaults to PERMANENT.
- ASSERT_EQ(PageAction::PERMANENT, page_action->type());
+ ASSERT_STREQ(id.c_str(), action->id().c_str());
+ ASSERT_STREQ(name.c_str(), action->name().c_str());
+ ASSERT_EQ(2u, action->icon_paths().size());
+ ASSERT_STREQ(img1.c_str(), action->icon_paths()[0].c_str());
+ ASSERT_STREQ(img2.c_str(), action->icon_paths()[1].c_str());
+ ASSERT_EQ(ContextualAction::PAGE_ACTION, action->type());
+
+ // Now try the same, but as a browser action.
+ action.reset(extension.LoadContextualActionHelper(
+ &input, 0, &error_msg, ContextualAction::BROWSER_ACTION));
+ ASSERT_TRUE(NULL != action.get());
+ ASSERT_STREQ("", error_msg.c_str());
+ // Browser actions don't have an id, page actions do.
+ ASSERT_STREQ("", action->id().c_str());
+ ASSERT_STREQ(name.c_str(), action->name().c_str());
+ ASSERT_EQ(2u, action->icon_paths().size());
+ ASSERT_STREQ(img1.c_str(), action->icon_paths()[0].c_str());
+ ASSERT_STREQ(img2.c_str(), action->icon_paths()[1].c_str());
+ ASSERT_EQ(ContextualAction::BROWSER_ACTION, action->type());
// Explicitly set the same type and parse again.
- input.SetString(keys::kType, values::kPageActionTypePermanent);
- page_action.reset(extension.LoadPageActionHelper(&input, 0, &error_msg));
- ASSERT_TRUE(NULL != page_action.get());
+ input.SetString(keys::kType, values::kPageActionTypeTab);
+ action.reset(extension.LoadContextualActionHelper(
+ &input, 0, &error_msg, ContextualAction::BROWSER_ACTION));
+ ASSERT_TRUE(NULL != action.get());
ASSERT_STREQ("", error_msg.c_str());
- ASSERT_EQ(PageAction::PERMANENT, page_action->type());
+ ASSERT_EQ(ContextualAction::BROWSER_ACTION, action->type());
- // Explicitly set the TAB type and parse again.
- input.SetString(keys::kType, values::kPageActionTypeTab);
- page_action.reset(extension.LoadPageActionHelper(&input, 0, &error_msg));
- ASSERT_TRUE(NULL != page_action.get());
+ // Explicitly set the PAGE_ACTION type and parse again.
+ input.SetString(keys::kType, values::kPageActionTypePermanent);
+ action.reset(extension.LoadContextualActionHelper(
+ &input, 0, &error_msg, ContextualAction::PAGE_ACTION));
+ ASSERT_TRUE(NULL != action.get());
ASSERT_STREQ("", error_msg.c_str());
- ASSERT_EQ(PageAction::TAB, page_action->type());
+ ASSERT_EQ(ContextualAction::PAGE_ACTION, action->type());
// Make a deep copy of the input and remove one key at a time and see if we
// get the right error.
@@ -334,34 +356,61 @@ TEST(ExtensionTest, LoadPageActionHelper) {
// First remove id key.
copy.reset(static_cast<DictionaryValue*>(input.DeepCopy()));
copy->Remove(keys::kPageActionId, NULL);
- page_action.reset(extension.LoadPageActionHelper(copy.get(), 0, &error_msg));
- ASSERT_TRUE(NULL == page_action.get());
+ action.reset(extension.LoadContextualActionHelper(
+ copy.get(), 0, &error_msg, ContextualAction::PAGE_ACTION));
+ ASSERT_TRUE(NULL == action.get());
ASSERT_TRUE(MatchPattern(error_msg.c_str(),
errors::kInvalidPageActionId));
+ error_msg = "";
+
+ // Same test (id key), but with browser action.
+ copy.reset(static_cast<DictionaryValue*>(input.DeepCopy()));
+ copy->Remove(keys::kPageActionId, NULL);
+ action.reset(extension.LoadContextualActionHelper(
+ copy.get(), 0, &error_msg, ContextualAction::BROWSER_ACTION));
+ // Having no id is valid for browser actions.
+ ASSERT_TRUE(NULL != action.get());
+ ASSERT_STREQ("", error_msg.c_str());
+ error_msg = "";
// Then remove the name key.
copy.reset(static_cast<DictionaryValue*>(input.DeepCopy()));
copy->Remove(keys::kName, NULL);
- page_action.reset(extension.LoadPageActionHelper(copy.get(), 0, &error_msg));
- ASSERT_TRUE(NULL == page_action.get());
+ action.reset(extension.LoadContextualActionHelper(
+ copy.get(), 0, &error_msg, ContextualAction::PAGE_ACTION));
+ ASSERT_TRUE(NULL == action.get());
+ ASSERT_TRUE(MatchPattern(error_msg.c_str(),
+ errors::kInvalidName));
+ error_msg = "";
+
+ // Same test (name key), but with browser action.
+ copy.reset(static_cast<DictionaryValue*>(input.DeepCopy()));
+ copy->Remove(keys::kName, NULL);
+ action.reset(extension.LoadContextualActionHelper(
+ copy.get(), 0, &error_msg, ContextualAction::BROWSER_ACTION));
+ ASSERT_TRUE(NULL == action.get());
ASSERT_TRUE(MatchPattern(error_msg.c_str(),
errors::kInvalidName));
+ error_msg = "";
// Then remove the icon paths key.
copy.reset(static_cast<DictionaryValue*>(input.DeepCopy()));
copy->Remove(keys::kPageActionIcons, NULL);
- page_action.reset(extension.LoadPageActionHelper(copy.get(), 0, &error_msg));
- ASSERT_TRUE(NULL == page_action.get());
+ action.reset(extension.LoadContextualActionHelper(
+ copy.get(), 0, &error_msg, ContextualAction::PAGE_ACTION));
+ ASSERT_TRUE(NULL == action.get());
ASSERT_TRUE(MatchPattern(error_msg.c_str(),
errors::kInvalidPageActionIconPaths));
+ error_msg = "";
- // Then set the type to something bogus.
+ // Same test (name key), but with browser action.
copy.reset(static_cast<DictionaryValue*>(input.DeepCopy()));
- copy->SetString(keys::kType, "something_bogus");
- page_action.reset(extension.LoadPageActionHelper(copy.get(), 0, &error_msg));
- ASSERT_TRUE(NULL == page_action.get());
+ copy->Remove(keys::kPageActionIcons, NULL);
+ action.reset(extension.LoadContextualActionHelper(
+ copy.get(), 0, &error_msg, ContextualAction::BROWSER_ACTION));
+ ASSERT_TRUE(NULL == action.get());
ASSERT_TRUE(MatchPattern(error_msg.c_str(),
- errors::kInvalidPageActionTypeValue));
+ errors::kInvalidPageActionIconPaths));
}
TEST(ExtensionTest, IdIsValid) {
diff --git a/chrome/common/page_action.cc b/chrome/common/page_action.cc
index 233a735..f2b6f24 100644
--- a/chrome/common/page_action.cc
+++ b/chrome/common/page_action.cc
@@ -4,9 +4,9 @@
#include "chrome/common/page_action.h"
-PageAction::PageAction()
- : type_(PERMANENT) {
+ContextualAction::ContextualAction()
+ : type_(PAGE_ACTION) {
}
-PageAction::~PageAction() {
+ContextualAction::~ContextualAction() {
}
diff --git a/chrome/common/page_action.h b/chrome/common/page_action.h
index 31a7c3d..8594ace 100644
--- a/chrome/common/page_action.h
+++ b/chrome/common/page_action.h
@@ -11,21 +11,21 @@
#include "base/basictypes.h"
-class PageAction {
+class ContextualAction {
public:
- PageAction();
- virtual ~PageAction();
+ ContextualAction();
+ virtual ~ContextualAction();
typedef enum {
- PERMANENT = 0,
- TAB = 1,
- } PageActionType;
+ PAGE_ACTION = 0,
+ BROWSER_ACTION = 1,
+ } ContextualActionType;
std::string id() const { return id_; }
void set_id(const std::string& id) { id_ = id; }
- PageActionType type() const { return type_; }
- void set_type(PageActionType type) { type_ = type; }
+ ContextualActionType type() const { return type_; }
+ void set_type(ContextualActionType type) { type_ = type; }
std::string extension_id() const { return extension_id_; }
void set_extension_id(const std::string& extension_id) {
@@ -41,30 +41,31 @@ class PageAction {
}
private:
- // The id for the PageAction, for example: "RssPageAction".
+ // The id for the ContextualAction, for example: "RssPageAction".
+ // For BrowserActions this is blank.
std::string id_;
- // The type of the PageAction.
- PageActionType type_;
+ // The type of the ContextualAction, either PageAction or BrowserAction.
+ ContextualActionType type_;
- // The id for the extension this PageAction belongs to (as defined in the
- // extension manifest).
+ // The id for the extension this ContextualAction belongs to (as defined in
+ // the extension manifest).
std::string extension_id_;
- // The name of the PageAction.
+ // The name of the ContextualAction.
std::string name_;
// The paths to the icons that this PageIcon can show.
std::vector<std::string> icon_paths_;
};
-typedef std::map<std::string, PageAction*> PageActionMap;
+typedef std::map<std::string, ContextualAction*> ContextualActionMap;
// This class keeps track of what values each tab uses to override the default
-// values of the PageAction.
-class PageActionState {
+// values of the ContextualAction.
+class ContextualActionState {
public:
- PageActionState(std::string title, int icon_index)
+ ContextualActionState(std::string title, int icon_index)
: title_(title), icon_index_(icon_index) {
}
@@ -78,7 +79,7 @@ class PageActionState {
// The icon to use.
int icon_index_;
- DISALLOW_COPY_AND_ASSIGN(PageActionState);
+ DISALLOW_COPY_AND_ASSIGN(ContextualActionState);
};
#endif // CHROME_COMMON_PAGE_ACTION_H_