| OLD | NEW |
| 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.h" | 7 #include "chrome/common/extensions/extension.h" |
| 8 #include "chrome/common/extensions/extension_set.h" | 8 #include "chrome/common/extensions/extension_set.h" |
| 9 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" | 9 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" |
| 10 | 10 |
| 11 namespace extensions { | 11 namespace extensions { |
| 12 | 12 |
| 13 const extensions::Extension* GetNonBookmarkAppExtension( | 13 const extensions::Extension* GetNonBookmarkAppExtension( |
| 14 const ExtensionSet& extensions, const ExtensionURLInfo& url) { | 14 const ExtensionSet& extensions, const GURL& url) { |
| 15 // Exclude bookmark apps, which do not use the app process model. | 15 // Exclude bookmark apps, which do not use the app process model. |
| 16 const extensions::Extension* extension = | 16 const extensions::Extension* extension = |
| 17 extensions.GetExtensionOrAppByURL(url); | 17 extensions.GetExtensionOrAppByURL(url); |
| 18 if (extension && extension->from_bookmark()) | 18 if (extension && extension->from_bookmark()) |
| 19 extension = NULL; | 19 extension = NULL; |
| 20 return extension; | 20 return extension; |
| 21 } | 21 } |
| 22 | 22 |
| 23 bool CrossesExtensionProcessBoundary( | 23 bool CrossesExtensionProcessBoundary( |
| 24 const ExtensionSet& extensions, | 24 const ExtensionSet& extensions, |
| 25 const ExtensionURLInfo& old_url, | 25 const GURL& old_url, |
| 26 const ExtensionURLInfo& new_url, | 26 const GURL& new_url, |
| 27 bool should_consider_workaround) { | 27 bool should_consider_workaround) { |
| 28 const extensions::Extension* old_url_extension = GetNonBookmarkAppExtension( | 28 const extensions::Extension* old_url_extension = GetNonBookmarkAppExtension( |
| 29 extensions, | 29 extensions, |
| 30 old_url); | 30 old_url); |
| 31 const extensions::Extension* new_url_extension = GetNonBookmarkAppExtension( | 31 const extensions::Extension* new_url_extension = GetNonBookmarkAppExtension( |
| 32 extensions, | 32 extensions, |
| 33 new_url); | 33 new_url); |
| 34 | 34 |
| 35 // TODO(creis): Temporary workaround for crbug.com/59285: Do not swap process | 35 // TODO(creis): Temporary workaround for crbug.com/59285: Do not swap process |
| 36 // to navigate from a hosted app to a normal page or another hosted app | 36 // to navigate from a hosted app to a normal page or another hosted app |
| (...skipping 18 matching lines...) Expand all Loading... |
| 55 if (old_url_is_hosted_app && | 55 if (old_url_is_hosted_app && |
| 56 new_url_is_normal_or_hosted && | 56 new_url_is_normal_or_hosted && |
| 57 !either_is_web_store) | 57 !either_is_web_store) |
| 58 return false; | 58 return false; |
| 59 } | 59 } |
| 60 | 60 |
| 61 return old_url_extension != new_url_extension; | 61 return old_url_extension != new_url_extension; |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace extensions | 64 } // namespace extensions |
| OLD | NEW |