| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 show_intent_picker_callback_.Run( | 243 show_intent_picker_callback_.Run( |
| 244 navigation_handle()->GetWebContents(), app_info, | 244 navigation_handle()->GetWebContents(), app_info, |
| 245 base::Bind(&ArcNavigationThrottle::OnIntentPickerClosed, | 245 base::Bind(&ArcNavigationThrottle::OnIntentPickerClosed, |
| 246 weak_ptr_factory_.GetWeakPtr(), base::Passed(&handlers))); | 246 weak_ptr_factory_.GetWeakPtr(), base::Passed(&handlers))); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void ArcNavigationThrottle::OnIntentPickerClosed( | 249 void ArcNavigationThrottle::OnIntentPickerClosed( |
| 250 mojo::Array<mojom::IntentHandlerInfoPtr> handlers, | 250 mojo::Array<mojom::IntentHandlerInfoPtr> handlers, |
| 251 std::string selected_app_package, | 251 const std::string& selected_app_package, |
| 252 CloseReason close_reason) { | 252 CloseReason close_reason) { |
| 253 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 253 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 254 const GURL& url = navigation_handle()->GetURL(); | 254 const GURL& url = navigation_handle()->GetURL(); |
| 255 content::NavigationHandle* handle = navigation_handle(); | 255 content::NavigationHandle* handle = navigation_handle(); |
| 256 previous_user_action_ = close_reason; | 256 previous_user_action_ = close_reason; |
| 257 | 257 |
| 258 // Make sure that the instance at least supports HandleUrl. | 258 // Make sure that the instance at least supports HandleUrl. |
| 259 auto* instance = ArcIntentHelperBridge::GetIntentHelperInstance( | 259 auto* instance = ArcIntentHelperBridge::GetIntentHelperInstance( |
| 260 "HandleUrl", kMinVersionForHandleUrl); | 260 "HandleUrl", kMinVersionForHandleUrl); |
| 261 size_t selected_app_index = handlers.size(); | 261 size_t selected_app_index = handlers.size(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 323 } |
| 324 | 324 |
| 325 // static | 325 // static |
| 326 bool ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( | 326 bool ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 327 const GURL& previous_url, | 327 const GURL& previous_url, |
| 328 const GURL& current_url) { | 328 const GURL& current_url) { |
| 329 return ShouldOverrideUrlLoading(previous_url, current_url); | 329 return ShouldOverrideUrlLoading(previous_url, current_url); |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace arc | 332 } // namespace arc |
| OLD | NEW |