OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |