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

Unified Diff: chrome/common/extensions/api/extension_action/action_info.cc

Issue 12042096: Move page action manifest parsing out of Extension; the first multi-key manifest handler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/api/extension_action/action_info.cc
diff --git a/chrome/common/extensions/api/extension_action/action_info.cc b/chrome/common/extensions/api/extension_action/action_info.cc
index 094923d755874afdde0688c42f54150d4989427a..ec957f84779d6abd985cfa773b684c0042904d8e 100644
--- a/chrome/common/extensions/api/extension_action/action_info.cc
+++ b/chrome/common/extensions/api/extension_action/action_info.cc
@@ -5,6 +5,7 @@
#include "chrome/common/extensions/api/extension_action/action_info.h"
#include "base/memory/scoped_ptr.h"
+#include "chrome/common/extensions/api/commands/commands_handler.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
@@ -49,6 +50,10 @@ const ActionInfo* ActionInfo::GetBrowserActionInfo(const Extension* extension) {
return GetActionInfo(extension, extension_manifest_keys::kBrowserAction);
}
+const ActionInfo* ActionInfo::GetPageActionInfo(const Extension* extension) {
+ return GetActionInfo(extension, extension_manifest_keys::kPageAction);
+}
+
// static
const ActionInfo* ActionInfo::GetScriptBadgeInfo(const Extension* extension) {
return GetActionInfo(extension, extension_manifest_keys::kScriptBadge);
@@ -66,6 +71,12 @@ void ActionInfo::SetBrowserActionInfo(Extension* extension, ActionInfo* info) {
}
// static
+void ActionInfo::SetPageActionInfo(Extension* extension, ActionInfo* info) {
+ extension->SetManifestData(extension_manifest_keys::kPageAction,
+ new ActionInfoData(info));
+}
+
+// static
void ActionInfo::SetScriptBadgeInfo(Extension* extension, ActionInfo* info) {
extension->SetManifestData(extension_manifest_keys::kScriptBadge,
new ActionInfoData(info));
@@ -77,4 +88,12 @@ void ActionInfo::SetPageLauncherInfo(Extension* extension, ActionInfo* info) {
new ActionInfoData(info));
}
+// static
+bool ActionInfo::IsVerboseInstallMessage(const Extension* extension) {
+ const ActionInfo* page_action_info = GetPageActionInfo(extension);
+ return page_action_info &&
+ (CommandsInfo::GetPageActionCommand(extension) ||
+ !page_action_info->default_icon.empty());
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698