| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "components/arc/intent_helper/activity_icon_loader.h" | 16 #include "components/arc/intent_helper/activity_icon_loader.h" |
| 17 #include "content/public/browser/navigation_throttle.h" | 17 #include "content/public/browser/navigation_throttle.h" |
| 18 #include "ui/gfx/image/image.h" | 18 #include "ui/gfx/image/image.h" |
| 19 | 19 #include "url/gurl.h" |
| 20 class GURL; | |
| 21 | 20 |
| 22 namespace content { | 21 namespace content { |
| 23 class NavigationHandle; | 22 class NavigationHandle; |
| 24 class WebContents; | 23 class WebContents; |
| 25 } // namespace content | 24 } // namespace content |
| 26 | 25 |
| 27 namespace arc { | 26 namespace arc { |
| 28 | 27 |
| 29 // A class that allow us to retrieve ARC app's information and handle URL | 28 // A class that allow us to retrieve ARC app's information and handle URL |
| 30 // traffic initiated on Chrome browser, either on Chrome or an ARC's app. | 29 // traffic initiated on Chrome browser, either on Chrome or an ARC's app. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 72 |
| 74 NavigationThrottle::ThrottleCheckResult HandleRequest(); | 73 NavigationThrottle::ThrottleCheckResult HandleRequest(); |
| 75 void OnAppCandidatesReceived( | 74 void OnAppCandidatesReceived( |
| 76 mojo::Array<mojom::IntentHandlerInfoPtr> handlers); | 75 mojo::Array<mojom::IntentHandlerInfoPtr> handlers); |
| 77 void OnAppIconsReceived( | 76 void OnAppIconsReceived( |
| 78 mojo::Array<mojom::IntentHandlerInfoPtr> handlers, | 77 mojo::Array<mojom::IntentHandlerInfoPtr> handlers, |
| 79 std::unique_ptr<ActivityIconLoader::ActivityToIconsMap> icons); | 78 std::unique_ptr<ActivityIconLoader::ActivityToIconsMap> icons); |
| 80 void OnIntentPickerClosed(mojo::Array<mojom::IntentHandlerInfoPtr> handlers, | 79 void OnIntentPickerClosed(mojo::Array<mojom::IntentHandlerInfoPtr> handlers, |
| 81 std::string selected_app_package, | 80 std::string selected_app_package, |
| 82 CloseReason close_reason); | 81 CloseReason close_reason); |
| 82 GURL GetStartingGURL() const; |
| 83 // A callback object that allow us to display an IntentPicker when Run() is | 83 // A callback object that allow us to display an IntentPicker when Run() is |
| 84 // executed, it also allow us to report the user's selection back to | 84 // executed, it also allow us to report the user's selection back to |
| 85 // OnIntentPickerClosed(). | 85 // OnIntentPickerClosed(). |
| 86 ShowIntentPickerCallback show_intent_picker_callback_; | 86 ShowIntentPickerCallback show_intent_picker_callback_; |
| 87 | 87 |
| 88 // A cache of the action the user took the last time this navigation throttle | 88 // A cache of the action the user took the last time this navigation throttle |
| 89 // popped up the intent picker dialog. If the dialog has never been popped up | 89 // popped up the intent picker dialog. If the dialog has never been popped up |
| 90 // before, this will have a value of CloseReason::INVALID. Used to avoid | 90 // before, this will have a value of CloseReason::INVALID. Used to avoid |
| 91 // popping up the dialog multiple times on chains of multiple redirects. | 91 // popping up the dialog multiple times on chains of multiple redirects. |
| 92 CloseReason previous_user_action_; | 92 CloseReason previous_user_action_; |
| 93 | 93 |
| 94 // Keeps a referrence to the starting GURL. |
| 95 GURL starting_gurl_; |
| 96 |
| 94 // This has to be the last member of the class. | 97 // This has to be the last member of the class. |
| 95 base::WeakPtrFactory<ArcNavigationThrottle> weak_ptr_factory_; | 98 base::WeakPtrFactory<ArcNavigationThrottle> weak_ptr_factory_; |
| 96 | 99 |
| 97 DISALLOW_COPY_AND_ASSIGN(ArcNavigationThrottle); | 100 DISALLOW_COPY_AND_ASSIGN(ArcNavigationThrottle); |
| 98 }; | 101 }; |
| 99 | 102 |
| 100 } // namespace arc | 103 } // namespace arc |
| 101 | 104 |
| 102 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_NAVIGATION_THROTTLE_H_ | 105 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_NAVIGATION_THROTTLE_H_ |
| OLD | NEW |