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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 10700007: Page actions behave as disableable browser actions when script badges are enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 798
799 return true; 799 return true;
800 } 800 }
801 801
802 scoped_ptr<ExtensionAction> Extension::LoadExtensionActionHelper( 802 scoped_ptr<ExtensionAction> Extension::LoadExtensionActionHelper(
803 const DictionaryValue* extension_action, 803 const DictionaryValue* extension_action,
804 ExtensionAction::Type action_type, 804 ExtensionAction::Type action_type,
805 string16* error) { 805 string16* error) {
806 scoped_ptr<ExtensionAction> result(new ExtensionAction(id(), action_type)); 806 scoped_ptr<ExtensionAction> result(new ExtensionAction(id(), action_type));
807 807
808 // Page actions are hidden by default, and browser actions ignore 808 // Page actions are hidden/disabled by default, and browser actions are
809 // visibility. 809 // visible/enabled by default.
810 result->SetIsVisible(ExtensionAction::kDefaultTabId, false); 810 result->SetIsVisible(ExtensionAction::kDefaultTabId,
811 action_type != ExtensionAction::TYPE_PAGE);
811 812
812 if (manifest_version_ == 1) { 813 if (manifest_version_ == 1) {
813 ListValue* icons = NULL; 814 ListValue* icons = NULL;
814 if (extension_action->HasKey(keys::kPageActionIcons) && 815 if (extension_action->HasKey(keys::kPageActionIcons) &&
815 extension_action->GetList(keys::kPageActionIcons, &icons)) { 816 extension_action->GetList(keys::kPageActionIcons, &icons)) {
816 for (ListValue::const_iterator iter = icons->begin(); 817 for (ListValue::const_iterator iter = icons->begin();
817 iter != icons->end(); ++iter) { 818 iter != icons->end(); ++iter) {
818 std::string path; 819 std::string path;
819 if (!(*iter)->GetAsString(&path) || path.empty()) { 820 if (!(*iter)->GetAsString(&path) || path.empty()) {
820 *error = ASCIIToUTF16(errors::kInvalidPageActionIconPath); 821 *error = ASCIIToUTF16(errors::kInvalidPageActionIconPath);
(...skipping 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after
3871 3872
3872 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 3873 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
3873 const Extension* extension, 3874 const Extension* extension,
3874 const PermissionSet* permissions, 3875 const PermissionSet* permissions,
3875 Reason reason) 3876 Reason reason)
3876 : reason(reason), 3877 : reason(reason),
3877 extension(extension), 3878 extension(extension),
3878 permissions(permissions) {} 3879 permissions(permissions) {}
3879 3880
3880 } // namespace extensions 3881 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698