| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser/chromeos/arc/arc_navigation_throttle.h" | 5 #include "chrome/browser/chromeos/arc/arc_navigation_throttle.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 mojom::IntentHelperInstance* GetIntentHelper() { | 30 mojom::IntentHelperInstance* GetIntentHelper() { |
| 31 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 31 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 32 ArcBridgeService* bridge_service = ArcBridgeService::Get(); | 32 ArcBridgeService* bridge_service = ArcBridgeService::Get(); |
| 33 if (!bridge_service) { | 33 if (!bridge_service) { |
| 34 VLOG(1) << "ARC bridge is not ready."; | 34 VLOG(1) << "ARC bridge is not ready."; |
| 35 return nullptr; | 35 return nullptr; |
| 36 } | 36 } |
| 37 mojom::IntentHelperInstance* intent_helper_instance = | 37 mojom::IntentHelperInstance* intent_helper_instance = |
| 38 bridge_service->intent_helper_instance(); | 38 bridge_service->intent_helper()->instance(); |
| 39 if (!intent_helper_instance) { | 39 if (!intent_helper_instance) { |
| 40 VLOG(1) << "ARC intent helper instance is not ready."; | 40 VLOG(1) << "ARC intent helper instance is not ready."; |
| 41 return nullptr; | 41 return nullptr; |
| 42 } | 42 } |
| 43 if (bridge_service->intent_helper_version() < kMinInstanceVersion) { | 43 if (bridge_service->intent_helper()->version() < kMinInstanceVersion) { |
| 44 VLOG(1) << "ARC intent helper instance is too old."; | 44 VLOG(1) << "ARC intent helper instance is too old."; |
| 45 return nullptr; | 45 return nullptr; |
| 46 } | 46 } |
| 47 return intent_helper_instance; | 47 return intent_helper_instance; |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 ArcNavigationThrottle::ArcNavigationThrottle( | 52 ArcNavigationThrottle::ArcNavigationThrottle( |
| 53 content::NavigationHandle* navigation_handle, | 53 content::NavigationHandle* navigation_handle, |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 bool ArcNavigationThrottle::ShouldOverrideUrlLoading( | 209 bool ArcNavigationThrottle::ShouldOverrideUrlLoading( |
| 210 content::NavigationHandle* navigation_handle) { | 210 content::NavigationHandle* navigation_handle) { |
| 211 GURL previous_url = navigation_handle->GetReferrer().url; | 211 GURL previous_url = navigation_handle->GetReferrer().url; |
| 212 GURL current_url = navigation_handle->GetURL(); | 212 GURL current_url = navigation_handle->GetURL(); |
| 213 return !net::registry_controlled_domains::SameDomainOrHost( | 213 return !net::registry_controlled_domains::SameDomainOrHost( |
| 214 current_url, previous_url, | 214 current_url, previous_url, |
| 215 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); | 215 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace arc | 218 } // namespace arc |
| OLD | NEW |