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

Side by Side Diff: extensions/common/permissions/permissions_data.cc

Issue 863743002: Allow silent update for default-installed apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "extensions/common/permissions/permissions_data.h" 5 #include "extensions/common/permissions/permissions_data.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/public/common/url_constants.h" 8 #include "content/public/common/url_constants.h"
9 #include "extensions/common/constants.h" 9 #include "extensions/common/constants.h"
10 #include "extensions/common/error_utils.h" 10 #include "extensions/common/error_utils.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 // static 46 // static
47 void PermissionsData::SetPolicyDelegate(PolicyDelegate* delegate) { 47 void PermissionsData::SetPolicyDelegate(PolicyDelegate* delegate) {
48 g_policy_delegate = delegate; 48 g_policy_delegate = delegate;
49 } 49 }
50 50
51 // static 51 // static
52 bool PermissionsData::CanSilentlyIncreasePermissions( 52 bool PermissionsData::CanSilentlyIncreasePermissions(
53 const Extension* extension) { 53 const Extension* extension) {
54 return extension->location() != Manifest::INTERNAL; 54 return extension->location() != Manifest::INTERNAL ||
55 extension->creation_flags() & Extension::WAS_INSTALLED_BY_DEFAULT;
not at google - send to devlin 2015/02/17 17:07:24 Hm, seems odd that EXTERNAL_PREF/REGISTRY isn't ex
55 } 56 }
56 57
57 // static 58 // static
58 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) { 59 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) {
59 if (extension->location() == Manifest::COMPONENT) 60 if (extension->location() == Manifest::COMPONENT)
60 return true; 61 return true;
61 62
62 const ExtensionsClient::ScriptingWhitelist& whitelist = 63 const ExtensionsClient::ScriptingWhitelist& whitelist =
63 ExtensionsClient::Get()->GetScriptingWhitelist(); 64 ExtensionsClient::Get()->GetScriptingWhitelist();
64 65
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 return ACCESS_WITHHELD; 361 return ACCESS_WITHHELD;
361 362
362 if (error) { 363 if (error) {
363 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, 364 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage,
364 document_url.spec()); 365 document_url.spec());
365 } 366 }
366 return ACCESS_DENIED; 367 return ACCESS_DENIED;
367 } 368 }
368 369
369 } // namespace extensions 370 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698