| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/transition_request_manager.h" | 5 #include "content/browser/transition_request_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 css_selector, | 132 css_selector, |
| 133 markup, | 133 markup, |
| 134 elements)); | 134 elements)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool TransitionRequestManager::TransitionRequestData::FindEntry( | 137 bool TransitionRequestManager::TransitionRequestData::FindEntry( |
| 138 const GURL& request_url, | 138 const GURL& request_url, |
| 139 TransitionLayerData* transition_data) { | 139 TransitionLayerData* transition_data) { |
| 140 DCHECK(!allowed_entries_.empty()); | 140 DCHECK(!allowed_entries_.empty()); |
| 141 CHECK(transition_data); | 141 CHECK(transition_data); |
| 142 CHECK(CommandLine::ForCurrentProcess()->HasSwitch( | 142 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 143 switches::kEnableExperimentalWebPlatformFeatures) || | 143 switches::kEnableExperimentalWebPlatformFeatures) || |
| 144 base::FieldTrialList::FindFullName("NavigationTransitions") == | 144 base::FieldTrialList::FindFullName("NavigationTransitions") == |
| 145 "Enabled"); | 145 "Enabled"); |
| 146 | 146 |
| 147 for (const AllowedEntry& allowed_entry : allowed_entries_) { | 147 for (const AllowedEntry& allowed_entry : allowed_entries_) { |
| 148 // Note: This is a small subset of the CSP source-list standard; once the | 148 // Note: This is a small subset of the CSP source-list standard; once the |
| 149 // full CSP support is moved from the renderer to the browser, we should | 149 // full CSP support is moved from the renderer to the browser, we should |
| 150 // use that instead. | 150 // use that instead. |
| 151 bool is_valid = (allowed_entry.allowed_destination_host_pattern == "*"); | 151 bool is_valid = (allowed_entry.allowed_destination_host_pattern == "*"); |
| 152 if (!is_valid) { | 152 if (!is_valid) { |
| 153 GURL allowed_host(allowed_entry.allowed_destination_host_pattern); | 153 GURL allowed_host(allowed_entry.allowed_destination_host_pattern); |
| 154 if (allowed_host.is_valid() && | 154 if (allowed_host.is_valid() && |
| 155 (allowed_host.GetOrigin() == request_url.GetOrigin())) { | 155 (allowed_host.GetOrigin() == request_url.GetOrigin())) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 TransitionRequestManager::~TransitionRequestManager() { | 222 TransitionRequestManager::~TransitionRequestManager() { |
| 223 } | 223 } |
| 224 | 224 |
| 225 // static | 225 // static |
| 226 TransitionRequestManager* TransitionRequestManager::GetInstance() { | 226 TransitionRequestManager* TransitionRequestManager::GetInstance() { |
| 227 return Singleton<TransitionRequestManager>::get(); | 227 return Singleton<TransitionRequestManager>::get(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace content | 230 } // namespace content |
| OLD | NEW |