| 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/intent_helper/arc_navigation_throttle.h" | 5 #include "chrome/browser/chromeos/arc/intent_helper/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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 ArcNavigationThrottle::ArcNavigationThrottle( | 90 ArcNavigationThrottle::ArcNavigationThrottle( |
| 91 content::NavigationHandle* navigation_handle, | 91 content::NavigationHandle* navigation_handle, |
| 92 const ShowIntentPickerCallback& show_intent_picker_cb) | 92 const ShowIntentPickerCallback& show_intent_picker_cb) |
| 93 : content::NavigationThrottle(navigation_handle), | 93 : content::NavigationThrottle(navigation_handle), |
| 94 show_intent_picker_callback_(show_intent_picker_cb), | 94 show_intent_picker_callback_(show_intent_picker_cb), |
| 95 previous_user_action_(CloseReason::INVALID), | 95 previous_user_action_(CloseReason::INVALID), |
| 96 weak_ptr_factory_(this) {} | 96 weak_ptr_factory_(this) {} |
| 97 | 97 |
| 98 ArcNavigationThrottle::~ArcNavigationThrottle() = default; | 98 ArcNavigationThrottle::~ArcNavigationThrottle() = default; |
| 99 | 99 |
| 100 const char* ArcNavigationThrottle::GetNameForLogging() { |
| 101 return "ArcNavigationThrottle"; |
| 102 } |
| 103 |
| 100 content::NavigationThrottle::ThrottleCheckResult | 104 content::NavigationThrottle::ThrottleCheckResult |
| 101 ArcNavigationThrottle::WillStartRequest() { | 105 ArcNavigationThrottle::WillStartRequest() { |
| 102 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 106 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 103 starting_gurl_ = GetStartingGURL(); | 107 starting_gurl_ = GetStartingGURL(); |
| 104 return HandleRequest(); | 108 return HandleRequest(); |
| 105 } | 109 } |
| 106 | 110 |
| 107 content::NavigationThrottle::ThrottleCheckResult | 111 content::NavigationThrottle::ThrottleCheckResult |
| 108 ArcNavigationThrottle::WillRedirectRequest() { | 112 ArcNavigationThrottle::WillRedirectRequest() { |
| 109 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 113 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 } | 427 } |
| 424 if (chrome_app_index < ArcNavigationThrottle::kMaxAppResults) | 428 if (chrome_app_index < ArcNavigationThrottle::kMaxAppResults) |
| 425 return false; | 429 return false; |
| 426 | 430 |
| 427 *out_indices = std::make_pair(ArcNavigationThrottle::kMaxAppResults - 1, | 431 *out_indices = std::make_pair(ArcNavigationThrottle::kMaxAppResults - 1, |
| 428 chrome_app_index); | 432 chrome_app_index); |
| 429 return true; | 433 return true; |
| 430 } | 434 } |
| 431 | 435 |
| 432 } // namespace arc | 436 } // namespace arc |
| OLD | NEW |