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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 | 805 |
806 return true; | 806 return true; |
807 } | 807 } |
808 | 808 |
809 scoped_ptr<ExtensionAction> Extension::LoadExtensionActionHelper( | 809 scoped_ptr<ExtensionAction> Extension::LoadExtensionActionHelper( |
810 const DictionaryValue* extension_action, | 810 const DictionaryValue* extension_action, |
811 ExtensionAction::Type action_type, | 811 ExtensionAction::Type action_type, |
812 string16* error) { | 812 string16* error) { |
813 scoped_ptr<ExtensionAction> result(new ExtensionAction(id(), action_type)); | 813 scoped_ptr<ExtensionAction> result(new ExtensionAction(id(), action_type)); |
814 | 814 |
815 // Page actions are hidden by default, and browser actions ignore | 815 // Page actions are hidden/disabled by default, and browser actions are |
816 // visibility. | 816 // visible/enabled by default. |
817 result->SetIsVisible(ExtensionAction::kDefaultTabId, false); | 817 if (action_type == ExtensionAction::TYPE_PAGE) |
| 818 result->SetIsVisible(ExtensionAction::kDefaultTabId, false); |
| 819 else |
| 820 result->SetIsVisible(ExtensionAction::kDefaultTabId, true); |
818 | 821 |
819 if (manifest_version_ == 1) { | 822 if (manifest_version_ == 1) { |
820 ListValue* icons = NULL; | 823 ListValue* icons = NULL; |
821 if (extension_action->HasKey(keys::kPageActionIcons) && | 824 if (extension_action->HasKey(keys::kPageActionIcons) && |
822 extension_action->GetList(keys::kPageActionIcons, &icons)) { | 825 extension_action->GetList(keys::kPageActionIcons, &icons)) { |
823 for (ListValue::const_iterator iter = icons->begin(); | 826 for (ListValue::const_iterator iter = icons->begin(); |
824 iter != icons->end(); ++iter) { | 827 iter != icons->end(); ++iter) { |
825 std::string path; | 828 std::string path; |
826 if (!(*iter)->GetAsString(&path) || path.empty()) { | 829 if (!(*iter)->GetAsString(&path) || path.empty()) { |
827 *error = ASCIIToUTF16(errors::kInvalidPageActionIconPath); | 830 *error = ASCIIToUTF16(errors::kInvalidPageActionIconPath); |
(...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3875 | 3878 |
3876 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3879 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
3877 const Extension* extension, | 3880 const Extension* extension, |
3878 const PermissionSet* permissions, | 3881 const PermissionSet* permissions, |
3879 Reason reason) | 3882 Reason reason) |
3880 : reason(reason), | 3883 : reason(reason), |
3881 extension(extension), | 3884 extension(extension), |
3882 permissions(permissions) {} | 3885 permissions(permissions) {} |
3883 | 3886 |
3884 } // namespace extensions | 3887 } // namespace extensions |
OLD | NEW |