Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1109)

Unified Diff: chrome/common/extensions/extension.h

Issue 10911300: Move ExtensionAction from common/ to browser/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: proof of concept Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension.h
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 22ca9fb9e72f599c8d42e0856c963e19a6256461..7391489a93e0827b8823b96b03996fd8a8247711 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -21,7 +21,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "chrome/common/extensions/command.h"
-#include "chrome/common/extensions/extension_action.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_icon_set.h"
#include "chrome/common/extensions/permissions/api_permission.h"
@@ -208,6 +207,28 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
std::vector<std::string> scopes;
};
+ // Manifest information for ExtensionActions.
+ struct ActionInfo {
+ // The types of extension actions.
+ enum Type {
+ TYPE_BROWSER,
Aaron Boodman 2012/09/16 01:42:50 Do we need to carry around the type? The caller kn
not at google - send to devlin 2012/09/27 00:46:10 It was initially added for when page actions got i
+ TYPE_PAGE,
+ TYPE_SCRIPT_BADGE,
+ };
+
+ explicit ActionInfo(Type action_type);
+ ~ActionInfo();
+
+ Type action_type;
+
+ // Empty implies not present.
+ std::string default_icon_path;
+ std::string default_title;
+ GURL default_popup_url;
+ // action id -- only used with legacy page actions API.
+ std::string id;
+ };
+
struct InstallWarning {
enum Format {
// IMPORTANT: Do not build HTML strings from user or developer-supplied
@@ -622,15 +643,15 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
return converted_from_user_script_;
}
const UserScriptList& content_scripts() const { return content_scripts_; }
- ExtensionAction* script_badge() const { return script_badge_.get(); }
- ExtensionAction* page_action() const { return page_action_.get(); }
- ExtensionAction* browser_action() const { return browser_action_.get(); }
+ ActionInfo* script_badge() const { return script_badge_.get(); }
+ ActionInfo* page_action() const { return page_action_.get(); }
+ ActionInfo* browser_action() const { return browser_action_.get(); }
bool is_verbose_install_message() const {
return !omnibox_keyword().empty() ||
browser_action() ||
(page_action() &&
(page_action_command() ||
- !page_action()->default_icon_path().empty()));
+ !page_action()->default_icon_path.empty()));
}
const FileBrowserHandlerList* file_browser_handlers() const {
return file_browser_handlers_.get();
@@ -919,11 +940,11 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
void(UserScript::*add_method)(const std::string& glob),
UserScript* instance);
- // Helper method to load an ExtensionAction from the page_action or
- // browser_action entries in the manifest.
- scoped_ptr<ExtensionAction> LoadExtensionActionHelper(
+ // Helper method to load an ActionInfo from the page_action,
+ // browser_action, or script_badge entries in the manifest.
+ scoped_ptr<ActionInfo> LoadExtensionActionHelper(
const base::DictionaryValue* extension_action,
- ExtensionAction::Type action_type,
+ ActionInfo::Type action_type,
string16* error);
// Helper method that loads the OAuth2 info from the 'oauth2' manifest key.
@@ -1028,13 +1049,13 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
UserScriptList content_scripts_;
// The extension's page action, if any.
- scoped_ptr<ExtensionAction> page_action_;
+ scoped_ptr<ActionInfo> page_action_;
// The extension's browser action, if any.
- scoped_ptr<ExtensionAction> browser_action_;
+ scoped_ptr<ActionInfo> browser_action_;
// The extension's script badge. Never NULL.
- scoped_ptr<ExtensionAction> script_badge_;
+ scoped_ptr<ActionInfo> script_badge_;
// The extension's file browser actions, if any.
scoped_ptr<FileBrowserHandlerList> file_browser_handlers_;

Powered by Google App Engine
This is Rietveld 408576698