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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 gfx::Image icon; | 214 gfx::Image icon; |
215 const ActivityIconLoader::ActivityName activity(handler->package_name, | 215 const ActivityIconLoader::ActivityName activity(handler->package_name, |
216 handler->activity_name); | 216 handler->activity_name); |
217 const auto it = icons->find(activity); | 217 const auto it = icons->find(activity); |
218 | 218 |
219 app_info.emplace_back( | 219 app_info.emplace_back( |
220 handler->name, it != icons->end() ? it->second.icon20 : gfx::Image()); | 220 handler->name, it != icons->end() ? it->second.icon20 : gfx::Image()); |
221 } | 221 } |
222 | 222 |
223 show_intent_picker_callback_.Run( | 223 show_intent_picker_callback_.Run( |
224 navigation_handle(), app_info, | 224 navigation_handle()->GetWebContents(), app_info, |
225 base::Bind(&ArcNavigationThrottle::OnIntentPickerClosed, | 225 base::Bind(&ArcNavigationThrottle::OnIntentPickerClosed, |
226 weak_ptr_factory_.GetWeakPtr(), base::Passed(&handlers))); | 226 weak_ptr_factory_.GetWeakPtr(), base::Passed(&handlers))); |
227 } | 227 } |
228 | 228 |
229 void ArcNavigationThrottle::OnIntentPickerClosed( | 229 void ArcNavigationThrottle::OnIntentPickerClosed( |
230 mojo::Array<mojom::UrlHandlerInfoPtr> handlers, | 230 mojo::Array<mojom::UrlHandlerInfoPtr> handlers, |
231 size_t selected_app_index, | 231 size_t selected_app_index, |
232 CloseReason close_reason) { | 232 CloseReason close_reason) { |
233 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 233 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
234 const GURL& url = navigation_handle()->GetURL(); | 234 const GURL& url = navigation_handle()->GetURL(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 bool ArcNavigationThrottle::ShouldOverrideUrlLoading( | 282 bool ArcNavigationThrottle::ShouldOverrideUrlLoading( |
283 content::NavigationHandle* navigation_handle) { | 283 content::NavigationHandle* navigation_handle) { |
284 GURL previous_url = navigation_handle->GetReferrer().url; | 284 GURL previous_url = navigation_handle->GetReferrer().url; |
285 GURL current_url = navigation_handle->GetURL(); | 285 GURL current_url = navigation_handle->GetURL(); |
286 return !net::registry_controlled_domains::SameDomainOrHost( | 286 return !net::registry_controlled_domains::SameDomainOrHost( |
287 current_url, previous_url, | 287 current_url, previous_url, |
288 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); | 288 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
289 } | 289 } |
290 | 290 |
291 } // namespace arc | 291 } // namespace arc |
OLD | NEW |