OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MERGE_SESSION_THROTTLE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MERGE_SESSION_THROTTLE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/browser/chromeos/login/merge_session_load_page.h" |
| 13 #include "content/public/browser/resource_throttle.h" |
| 14 #include "net/base/completion_callback.h" |
| 15 |
| 16 namespace net { |
| 17 class URLRequest; |
| 18 } |
| 19 |
| 20 // Used to show an interstitial page while merge session process (cookie |
| 21 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in |
| 22 // progress while we are attempting to load a google property. |
| 23 class MergeSessionThrottle |
| 24 : public content::ResourceThrottle, |
| 25 public base::SupportsWeakPtr<MergeSessionThrottle> { |
| 26 public: |
| 27 MergeSessionThrottle(int render_process_id, |
| 28 int render_view_id, |
| 29 net::URLRequest* request); |
| 30 virtual ~MergeSessionThrottle(); |
| 31 |
| 32 // content::ResourceThrottle implementation: |
| 33 virtual void WillStartRequest(bool* defer) OVERRIDE; |
| 34 |
| 35 private: |
| 36 // MergeSessionLoadPage callback. |
| 37 void OnBlockingPageComplete(bool proceed); |
| 38 |
| 39 // Erase the state associated with a deferred load request. |
| 40 void ClearRequestInfo(); |
| 41 bool IsRemote(const GURL& url) const; |
| 42 |
| 43 // True if we should show the merge session in progress page. |
| 44 bool ShouldShowMergeSessionPage(const GURL& url) const; |
| 45 |
| 46 int render_process_id_; |
| 47 int render_view_id_; |
| 48 net::URLRequest* request_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(MergeSessionThrottle); |
| 51 }; |
| 52 |
| 53 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MERGE_SESSION_THROTTLE_H_ |
OLD | NEW |