| 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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 3048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3869 | 3870 |
| 3870 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3871 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 3871 const Extension* extension, | 3872 const Extension* extension, |
| 3872 const PermissionSet* permissions, | 3873 const PermissionSet* permissions, |
| 3873 Reason reason) | 3874 Reason reason) |
| 3874 : reason(reason), | 3875 : reason(reason), |
| 3875 extension(extension), | 3876 extension(extension), |
| 3876 permissions(permissions) {} | 3877 permissions(permissions) {} |
| 3877 | 3878 |
| 3878 } // namespace extensions | 3879 } // namespace extensions |
| OLD | NEW |