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

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: Add expectations for IncognitoInfo to test 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
« no previous file with comments | « extensions/common/extension.h ('k') | extensions/common/manifest_constants.h » ('j') | 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/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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 432 }
432 433
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 // Only component platform apps are supported in incognito.
443 return !is_platform_app() || location() == Manifest::COMPONENT;
444 }
445
446 void Extension::AddWebExtentPattern(const URLPattern& pattern) { 442 void Extension::AddWebExtentPattern(const URLPattern& pattern) {
447 // Bookmark apps are permissionless. 443 // Bookmark apps are permissionless.
448 if (from_bookmark()) 444 if (from_bookmark())
449 return; 445 return;
450 446
451 extent_.AddPattern(pattern); 447 extent_.AddPattern(pattern);
452 } 448 }
453 449
454 // static 450 // static
455 bool Extension::InitExtensionID(extensions::Manifest* manifest, 451 bool Extension::InitExtensionID(extensions::Manifest* manifest,
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 781
786 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 782 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
787 const Extension* extension, 783 const Extension* extension,
788 const PermissionSet* permissions, 784 const PermissionSet* permissions,
789 Reason reason) 785 Reason reason)
790 : reason(reason), 786 : reason(reason),
791 extension(extension), 787 extension(extension),
792 permissions(permissions) {} 788 permissions(permissions) {}
793 789
794 } // namespace extensions 790 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/extension.h ('k') | extensions/common/manifest_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698