| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_LOGIN_SIGNIN_MERGE_SESSION_NAVIGATION_THROTTLE_H
_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_NAVIGATION_THROTTLE_H
_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_NAVIGATION_THROTTLE_H
_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_NAVIGATION_THROTTLE_H
_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 11 #include "content/public/browser/navigation_throttle.h" | 12 #include "content/public/browser/navigation_throttle.h" |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 class NavigationHandle; | 15 class NavigationHandle; |
| 15 } | 16 } |
| 16 | 17 |
| 17 // Used to show an interstitial page while merge session process (cookie | 18 // Used to show an interstitial page while merge session process (cookie |
| 18 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in | 19 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in |
| 19 // progress while we are attempting to load a google property. | 20 // progress while we are attempting to load a google property. |
| 20 class MergeSessionNavigationThrottle : public content::NavigationThrottle { | 21 class MergeSessionNavigationThrottle : public content::NavigationThrottle { |
| 21 public: | 22 public: |
| 22 static scoped_ptr<content::NavigationThrottle> Create( | 23 static std::unique_ptr<content::NavigationThrottle> Create( |
| 23 content::NavigationHandle* handle); | 24 content::NavigationHandle* handle); |
| 24 ~MergeSessionNavigationThrottle() override; | 25 ~MergeSessionNavigationThrottle() override; |
| 25 | 26 |
| 26 private: | 27 private: |
| 27 explicit MergeSessionNavigationThrottle(content::NavigationHandle* handle); | 28 explicit MergeSessionNavigationThrottle(content::NavigationHandle* handle); |
| 28 | 29 |
| 29 // content::NavigationThrottle implementation: | 30 // content::NavigationThrottle implementation: |
| 30 content::NavigationThrottle::ThrottleCheckResult WillStartRequest() override; | 31 content::NavigationThrottle::ThrottleCheckResult WillStartRequest() override; |
| 31 | 32 |
| 32 // MergeSessionLoadPage callback. | 33 // MergeSessionLoadPage callback. |
| 33 void OnBlockingPageComplete(); | 34 void OnBlockingPageComplete(); |
| 34 | 35 |
| 35 base::WeakPtrFactory<MergeSessionNavigationThrottle> weak_factory_; | 36 base::WeakPtrFactory<MergeSessionNavigationThrottle> weak_factory_; |
| 36 | 37 |
| 37 DISALLOW_COPY_AND_ASSIGN(MergeSessionNavigationThrottle); | 38 DISALLOW_COPY_AND_ASSIGN(MergeSessionNavigationThrottle); |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_NAVIGATION_THROTTL
E_H_ | 41 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_NAVIGATION_THROTTL
E_H_ |
| OLD | NEW |