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

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

Issue 10823143: Make the getAttention badge grey. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move the Grant/Appearance code into the switch Created 8 years, 4 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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 } 801 }
802 802
803 scoped_ptr<ExtensionAction> Extension::LoadExtensionActionHelper( 803 scoped_ptr<ExtensionAction> Extension::LoadExtensionActionHelper(
804 const DictionaryValue* extension_action, 804 const DictionaryValue* extension_action,
805 ExtensionAction::Type action_type, 805 ExtensionAction::Type action_type,
806 string16* error) { 806 string16* error) {
807 scoped_ptr<ExtensionAction> result(new ExtensionAction(id(), action_type)); 807 scoped_ptr<ExtensionAction> result(new ExtensionAction(id(), action_type));
808 808
809 // Page/script actions are hidden/disabled by default, and browser actions are 809 // Page/script actions are hidden/disabled by default, and browser actions are
810 // visible/enabled by default. 810 // visible/enabled by default.
811 result->SetIsVisible(ExtensionAction::kDefaultTabId, 811 result->SetAppearance(ExtensionAction::kDefaultTabId,
812 action_type == ExtensionAction::TYPE_BROWSER); 812 action_type == ExtensionAction::TYPE_BROWSER ?
813 ExtensionAction::ACTIVE : ExtensionAction::INVISIBLE);
813 814
814 if (manifest_version_ == 1) { 815 if (manifest_version_ == 1) {
815 const ListValue* icons = NULL; 816 const ListValue* icons = NULL;
816 if (extension_action->HasKey(keys::kPageActionIcons) && 817 if (extension_action->HasKey(keys::kPageActionIcons) &&
817 extension_action->GetList(keys::kPageActionIcons, &icons)) { 818 extension_action->GetList(keys::kPageActionIcons, &icons)) {
818 for (ListValue::const_iterator iter = icons->begin(); 819 for (ListValue::const_iterator iter = icons->begin();
819 iter != icons->end(); ++iter) { 820 iter != icons->end(); ++iter) {
820 std::string path; 821 std::string path;
821 if (!(*iter)->GetAsString(&path) || path.empty()) { 822 if (!(*iter)->GetAsString(&path) || path.empty()) {
822 *error = ASCIIToUTF16(errors::kInvalidPageActionIconPath); 823 *error = ASCIIToUTF16(errors::kInvalidPageActionIconPath);
(...skipping 3059 matching lines...) Expand 10 before | Expand all | Expand 10 after
3882 3883
3883 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 3884 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
3884 const Extension* extension, 3885 const Extension* extension,
3885 const PermissionSet* permissions, 3886 const PermissionSet* permissions,
3886 Reason reason) 3887 Reason reason)
3887 : reason(reason), 3888 : reason(reason),
3888 extension(extension), 3889 extension(extension),
3889 permissions(permissions) {} 3890 permissions(permissions) {}
3890 3891
3891 } // namespace extensions 3892 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/script_badge_controller.cc ('k') | chrome/common/extensions/extension_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698