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

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

Issue 515563003: Remove dependency of chrome in WebRequestPermissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated. Created 6 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) 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_process_policy.h" 5 #include "chrome/common/extensions/extension_process_policy.h"
6 6
7 #include "chrome/common/extensions/extension_constants.h" 7 #include "chrome/common/extensions/extension_constants.h"
8 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" 8 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h"
9 #include "extensions/common/constants.h"
9 #include "extensions/common/extension.h" 10 #include "extensions/common/extension.h"
10 #include "extensions/common/extension_set.h" 11 #include "extensions/common/extension_set.h"
11 12
12 namespace extensions { 13 namespace extensions {
13 14
14 const extensions::Extension* GetNonBookmarkAppExtension( 15 const extensions::Extension* GetNonBookmarkAppExtension(
15 const ExtensionSet& extensions, const GURL& url) { 16 const ExtensionSet& extensions, const GURL& url) {
16 // Exclude bookmark apps, which do not use the app process model. 17 // Exclude bookmark apps, which do not use the app process model.
17 const extensions::Extension* extension = 18 const extensions::Extension* extension =
18 extensions.GetExtensionOrAppByURL(url); 19 extensions.GetExtensionOrAppByURL(url);
(...skipping 24 matching lines...) Expand all
43 // process separation from non-app pages. 44 // process separation from non-app pages.
44 if (should_consider_workaround) { 45 if (should_consider_workaround) {
45 bool old_url_is_hosted_app = old_url_extension && 46 bool old_url_is_hosted_app = old_url_extension &&
46 !old_url_extension->web_extent().is_empty() && 47 !old_url_extension->web_extent().is_empty() &&
47 !AppIsolationInfo::HasIsolatedStorage(old_url_extension); 48 !AppIsolationInfo::HasIsolatedStorage(old_url_extension);
48 bool new_url_is_normal_or_hosted = !new_url_extension || 49 bool new_url_is_normal_or_hosted = !new_url_extension ||
49 (!new_url_extension->web_extent().is_empty() && 50 (!new_url_extension->web_extent().is_empty() &&
50 !AppIsolationInfo::HasIsolatedStorage(new_url_extension)); 51 !AppIsolationInfo::HasIsolatedStorage(new_url_extension));
51 bool either_is_web_store = 52 bool either_is_web_store =
52 (old_url_extension && 53 (old_url_extension &&
53 old_url_extension->id() == extension_misc::kWebStoreAppId) || 54 old_url_extension->id() == extensions::kWebStoreAppId) ||
54 (new_url_extension && 55 (new_url_extension &&
55 new_url_extension->id() == extension_misc::kWebStoreAppId); 56 new_url_extension->id() == extensions::kWebStoreAppId);
56 if (old_url_is_hosted_app && 57 if (old_url_is_hosted_app &&
57 new_url_is_normal_or_hosted && 58 new_url_is_normal_or_hosted &&
58 !either_is_web_store) 59 !either_is_web_store)
59 return false; 60 return false;
60 } 61 }
61 62
62 return old_url_extension != new_url_extension; 63 return old_url_extension != new_url_extension;
63 } 64 }
64 65
65 } // namespace extensions 66 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | chrome/common/extensions/manifest_handlers/app_launch_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698