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

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

Issue 9877018: Lazy background page branding: "Transient Background Page". Rename (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: error msg Created 8 years, 9 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
1795 } else { 1795 } else {
1796 background_url_ = GetResourceURL(background_str); 1796 background_url_ = GetResourceURL(background_str);
1797 } 1797 }
1798 1798
1799 return true; 1799 return true;
1800 } 1800 }
1801 1801
1802 bool Extension::LoadBackgroundPersistent( 1802 bool Extension::LoadBackgroundPersistent(
1803 const ExtensionAPIPermissionSet& api_permissions, 1803 const ExtensionAPIPermissionSet& api_permissions,
1804 string16* error) { 1804 string16* error) {
1805 Value* background_persistent = NULL; 1805 Value* background_persistent = NULL;
Yoyo Zhou 2012/03/28 21:55:28 Might want to rename this too.
1806 if (!api_permissions.count(ExtensionAPIPermission::kExperimental) || 1806 if (!api_permissions.count(ExtensionAPIPermission::kExperimental) ||
1807 !manifest_->Get(keys::kBackgroundPersistent, &background_persistent)) 1807 !manifest_->Get(keys::kBackgroundTransient, &background_persistent))
1808 return true; 1808 return true;
1809 1809
1810 if (!background_persistent->IsType(Value::TYPE_BOOLEAN) || 1810 if (!background_persistent->IsType(Value::TYPE_BOOLEAN) ||
1811 !background_persistent->GetAsBoolean(&background_page_persists_)) { 1811 !background_persistent->GetAsBoolean(&background_page_is_transient_)) {
1812 *error = ASCIIToUTF16(errors::kInvalidBackgroundPersistent); 1812 *error = ASCIIToUTF16(errors::kInvalidBackgroundTransient);
1813 return false; 1813 return false;
1814 } 1814 }
1815 1815
1816 if (!has_background_page()) { 1816 if (!has_background_page()) {
1817 *error = ASCIIToUTF16(errors::kInvalidBackgroundPersistentNoPage); 1817 *error = ASCIIToUTF16(errors::kInvalidBackgroundTransientNoPage);
1818 return false; 1818 return false;
1819 } 1819 }
1820 1820
1821 return true; 1821 return true;
1822 } 1822 }
1823 1823
1824 bool Extension::LoadBackgroundAllowJSAccess( 1824 bool Extension::LoadBackgroundAllowJSAccess(
1825 const ExtensionAPIPermissionSet& api_permissions, 1825 const ExtensionAPIPermissionSet& api_permissions,
1826 string16* error) { 1826 string16* error) {
1827 Value* allow_js_access = NULL; 1827 Value* allow_js_access = NULL;
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 // See http://b/4946060 for more details. 2725 // See http://b/4946060 for more details.
2726 return id == std::string("nckgahadagoaajjgafhacjanaoiihapd"); 2726 return id == std::string("nckgahadagoaajjgafhacjanaoiihapd");
2727 } 2727 }
2728 2728
2729 Extension::Extension(const FilePath& path, 2729 Extension::Extension(const FilePath& path,
2730 scoped_ptr<extensions::Manifest> manifest) 2730 scoped_ptr<extensions::Manifest> manifest)
2731 : manifest_version_(0), 2731 : manifest_version_(0),
2732 incognito_split_mode_(false), 2732 incognito_split_mode_(false),
2733 offline_enabled_(false), 2733 offline_enabled_(false),
2734 converted_from_user_script_(false), 2734 converted_from_user_script_(false),
2735 background_page_persists_(true), 2735 background_page_is_transient_(false),
2736 allow_background_js_access_(true), 2736 allow_background_js_access_(true),
2737 manifest_(manifest.release()), 2737 manifest_(manifest.release()),
2738 is_storage_isolated_(false), 2738 is_storage_isolated_(false),
2739 launch_container_(extension_misc::LAUNCH_TAB), 2739 launch_container_(extension_misc::LAUNCH_TAB),
2740 launch_width_(0), 2740 launch_width_(0),
2741 launch_height_(0), 2741 launch_height_(0),
2742 launch_min_width_(0), 2742 launch_min_width_(0),
2743 launch_min_height_(0), 2743 launch_min_height_(0),
2744 launch_max_width_(0), 2744 launch_max_width_(0),
2745 launch_max_height_(0), 2745 launch_max_height_(0),
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
3567 already_disabled(false), 3567 already_disabled(false),
3568 extension(extension) {} 3568 extension(extension) {}
3569 3569
3570 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 3570 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
3571 const Extension* extension, 3571 const Extension* extension,
3572 const ExtensionPermissionSet* permissions, 3572 const ExtensionPermissionSet* permissions,
3573 Reason reason) 3573 Reason reason)
3574 : reason(reason), 3574 : reason(reason),
3575 extension(extension), 3575 extension(extension),
3576 permissions(permissions) {} 3576 permissions(permissions) {}
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_manifest_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698