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

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

Issue 1351223003: Allow extensions to specify that they are not allowed in incognito mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor formatting Created 5 years, 3 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
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/extension.h" 5 #include "extensions/common/extension.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 10 matching lines...) Expand all
21 #include "base/values.h" 21 #include "base/values.h"
22 #include "base/version.h" 22 #include "base/version.h"
23 #include "components/crx_file/id_util.h" 23 #include "components/crx_file/id_util.h"
24 #include "content/public/common/url_constants.h" 24 #include "content/public/common/url_constants.h"
25 #include "extensions/common/constants.h" 25 #include "extensions/common/constants.h"
26 #include "extensions/common/error_utils.h" 26 #include "extensions/common/error_utils.h"
27 #include "extensions/common/feature_switch.h" 27 #include "extensions/common/feature_switch.h"
28 #include "extensions/common/manifest.h" 28 #include "extensions/common/manifest.h"
29 #include "extensions/common/manifest_constants.h" 29 #include "extensions/common/manifest_constants.h"
30 #include "extensions/common/manifest_handler.h" 30 #include "extensions/common/manifest_handler.h"
31 #include "extensions/common/manifest_handlers/incognito_info.h"
31 #include "extensions/common/manifest_handlers/permissions_parser.h" 32 #include "extensions/common/manifest_handlers/permissions_parser.h"
32 #include "extensions/common/permissions/permission_set.h" 33 #include "extensions/common/permissions/permission_set.h"
33 #include "extensions/common/permissions/permissions_data.h" 34 #include "extensions/common/permissions/permissions_data.h"
34 #include "extensions/common/permissions/permissions_info.h" 35 #include "extensions/common/permissions/permissions_info.h"
35 #include "extensions/common/switches.h" 36 #include "extensions/common/switches.h"
36 #include "extensions/common/url_pattern.h" 37 #include "extensions/common/url_pattern.h"
37 #include "net/base/filename_util.h" 38 #include "net/base/filename_util.h"
38 #include "url/url_util.h" 39 #include "url/url_util.h"
39 40
40 namespace extensions { 41 namespace extensions {
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 bool Extension::is_shared_module() const { 434 bool Extension::is_shared_module() const {
434 return manifest()->is_shared_module(); 435 return manifest()->is_shared_module();
435 } 436 }
436 437
437 bool Extension::is_theme() const { 438 bool Extension::is_theme() const {
438 return manifest()->is_theme(); 439 return manifest()->is_theme();
439 } 440 }
440 441
441 bool Extension::can_be_incognito_enabled() const { 442 bool Extension::can_be_incognito_enabled() const {
442 // Only component platform apps are supported in incognito. 443 // Only component platform apps are supported in incognito.
443 return !is_platform_app() || location() == Manifest::COMPONENT; 444 return IncognitoInfo::IsIncognitoAllowed(this) &&
not at google - send to devlin 2015/09/17 22:59:54 This function has too much logic, especially for o
Not at Google. Contact bengr 2015/09/18 21:24:31 Done.
445 (!is_platform_app() || location() == Manifest::COMPONENT);
444 } 446 }
445 447
446 void Extension::AddWebExtentPattern(const URLPattern& pattern) { 448 void Extension::AddWebExtentPattern(const URLPattern& pattern) {
447 // Bookmark apps are permissionless. 449 // Bookmark apps are permissionless.
448 if (from_bookmark()) 450 if (from_bookmark())
449 return; 451 return;
450 452
451 extent_.AddPattern(pattern); 453 extent_.AddPattern(pattern);
452 } 454 }
453 455
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 787
786 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 788 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
787 const Extension* extension, 789 const Extension* extension,
788 const PermissionSet* permissions, 790 const PermissionSet* permissions,
789 Reason reason) 791 Reason reason)
790 : reason(reason), 792 : reason(reason),
791 extension(extension), 793 extension(extension),
792 permissions(permissions) {} 794 permissions(permissions) {}
793 795
794 } // namespace extensions 796 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/common/manifest_constants.h » ('j') | extensions/common/manifest_handlers/incognito_info.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698