| 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 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_NAVIGATION_THROTTLE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_NAVIGATION_THROTTLE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_NAVIGATION_THROTTLE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_NAVIGATION_THROTTLE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 static bool ShouldOverrideUrlLoadingForTesting(const GURL& previous_url, | 59 static bool ShouldOverrideUrlLoadingForTesting(const GURL& previous_url, |
| 60 const GURL& current_url); | 60 const GURL& current_url); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 // content::Navigation implementation: | 63 // content::Navigation implementation: |
| 64 NavigationThrottle::ThrottleCheckResult WillStartRequest() override; | 64 NavigationThrottle::ThrottleCheckResult WillStartRequest() override; |
| 65 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override; | 65 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override; |
| 66 | 66 |
| 67 NavigationThrottle::ThrottleCheckResult HandleRequest(); | 67 NavigationThrottle::ThrottleCheckResult HandleRequest(); |
| 68 void OnAppCandidatesReceived(mojo::Array<mojom::UrlHandlerInfoPtr> handlers); | 68 void OnAppCandidatesReceived( |
| 69 mojo::Array<mojom::IntentHandlerInfoPtr> handlers); |
| 69 void OnAppIconsReceived( | 70 void OnAppIconsReceived( |
| 70 mojo::Array<mojom::UrlHandlerInfoPtr> handlers, | 71 mojo::Array<mojom::IntentHandlerInfoPtr> handlers, |
| 71 std::unique_ptr<ActivityIconLoader::ActivityToIconsMap> icons); | 72 std::unique_ptr<ActivityIconLoader::ActivityToIconsMap> icons); |
| 72 void OnIntentPickerClosed(mojo::Array<mojom::UrlHandlerInfoPtr> handlers, | 73 void OnIntentPickerClosed(mojo::Array<mojom::IntentHandlerInfoPtr> handlers, |
| 73 size_t selected_app_index, | 74 size_t selected_app_index, |
| 74 CloseReason close_reason); | 75 CloseReason close_reason); |
| 75 // A callback object that allow us to display an IntentPicker when Run() is | 76 // A callback object that allow us to display an IntentPicker when Run() is |
| 76 // executed, it also allow us to report the user's selection back to | 77 // executed, it also allow us to report the user's selection back to |
| 77 // OnIntentPickerClosed(). | 78 // OnIntentPickerClosed(). |
| 78 ShowIntentPickerCallback show_intent_picker_callback_; | 79 ShowIntentPickerCallback show_intent_picker_callback_; |
| 79 | 80 |
| 80 // A cache of the action the user took the last time this navigation throttle | 81 // A cache of the action the user took the last time this navigation throttle |
| 81 // popped up the intent picker dialog. If the dialog has never been popped up | 82 // popped up the intent picker dialog. If the dialog has never been popped up |
| 82 // before, this will have a value of CloseReason::INVALID. Used to avoid | 83 // before, this will have a value of CloseReason::INVALID. Used to avoid |
| 83 // popping up the dialog multiple times on chains of multiple redirects. | 84 // popping up the dialog multiple times on chains of multiple redirects. |
| 84 CloseReason previous_user_action_; | 85 CloseReason previous_user_action_; |
| 85 | 86 |
| 86 // This has to be the last member of the class. | 87 // This has to be the last member of the class. |
| 87 base::WeakPtrFactory<ArcNavigationThrottle> weak_ptr_factory_; | 88 base::WeakPtrFactory<ArcNavigationThrottle> weak_ptr_factory_; |
| 88 | 89 |
| 89 DISALLOW_COPY_AND_ASSIGN(ArcNavigationThrottle); | 90 DISALLOW_COPY_AND_ASSIGN(ArcNavigationThrottle); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 } // namespace arc | 93 } // namespace arc |
| 93 | 94 |
| 94 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_NAVIGATION_THROTTLE_H_ | 95 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_NAVIGATION_THROTTLE_H_ |
| OLD | NEW |