| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "chrome/common/extensions/extension_constants.h" | 10 #include "chrome/common/extensions/extension_constants.h" |
| 11 #include "content/public/common/content_switches.h" |
| 11 #include "extensions/common/constants.h" | 12 #include "extensions/common/constants.h" |
| 12 #include "extensions/common/extension.h" | 13 #include "extensions/common/extension.h" |
| 13 #include "extensions/common/extension_set.h" | 14 #include "extensions/common/extension_set.h" |
| 14 #include "extensions/common/manifest_handlers/app_isolation_info.h" | 15 #include "extensions/common/manifest_handlers/app_isolation_info.h" |
| 15 #include "extensions/common/switches.h" | 16 #include "extensions/common/switches.h" |
| 16 | 17 |
| 17 namespace extensions { | 18 namespace extensions { |
| 18 | 19 |
| 19 const extensions::Extension* GetNonBookmarkAppExtension( | 20 const extensions::Extension* GetNonBookmarkAppExtension( |
| 20 const ExtensionSet& extensions, const GURL& url) { | 21 const ExtensionSet& extensions, const GURL& url) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if (old_url_is_hosted_app && | 62 if (old_url_is_hosted_app && |
| 62 new_url_is_normal_or_hosted && | 63 new_url_is_normal_or_hosted && |
| 63 !either_is_web_store) | 64 !either_is_web_store) |
| 64 return false; | 65 return false; |
| 65 } | 66 } |
| 66 | 67 |
| 67 return old_url_extension != new_url_extension; | 68 return old_url_extension != new_url_extension; |
| 68 } | 69 } |
| 69 | 70 |
| 70 bool IsIsolateExtensionsEnabled() { | 71 bool IsIsolateExtensionsEnabled() { |
| 72 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 73 switches::kIsolateExtensions) || |
| 74 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 75 ::switches::kSitePerProcess)) { |
| 76 return true; |
| 77 } |
| 78 |
| 71 const std::string group_name = | 79 const std::string group_name = |
| 72 base::FieldTrialList::FindFullName("SiteIsolationExtensions"); | 80 base::FieldTrialList::FindFullName("SiteIsolationExtensions"); |
| 73 bool is_control_group = base::StartsWith( | 81 // Use StartsWith() for more flexibility (e.g. multiple Enabled groups). |
| 74 group_name, "Control", base::CompareCase::INSENSITIVE_ASCII); | 82 return base::StartsWith(group_name, "Enabled", |
| 75 return !is_control_group; | 83 base::CompareCase::INSENSITIVE_ASCII); |
| 76 } | 84 } |
| 77 | 85 |
| 78 } // namespace extensions | 86 } // namespace extensions |
| OLD | NEW |