OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_THROTTLING_UTILS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_THROTTLING_UTILS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_THROTTLING_UTILS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_THROTTLING_UTILS_H_ |
7 | 7 |
8 #include "base/atomic_ref_count.h" | 8 #include "base/atomic_ref_count.h" |
9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
10 | 10 |
11 class GURL; | 11 class GURL; |
12 class Profile; | 12 class Profile; |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class WebContents; | 15 class WebContents; |
16 } | 16 } |
17 | 17 |
18 // A set of helper functions used by the MergeSessionNavigationThrottle and the | 18 // A set of helper functions used by the MergeSessionNavigationThrottle and the |
19 // MergeSessionResourceThrottle to determine if an interstitial page should be | 19 // MergeSessionResourceThrottle to determine if an interstitial page should be |
20 // shown for a request when the merge session process (cookie reconstruction | 20 // shown for a request when the merge session process (cookie reconstruction |
21 // from OAuth2 refresh token in ChromeOS login) is still in progress. | 21 // from OAuth2 refresh token in ChromeOS login) is still in progress. |
22 namespace merge_session_throttling_utils { | 22 namespace merge_session_throttling_utils { |
23 | 23 |
24 // Passed a boolean indicating whether or not it is OK to proceed with the | 24 // Passed a boolean indicating whether or not it is OK to proceed with the |
25 // page load. | 25 // page load. |
26 using CompletionCallback = base::Closure; | 26 using CompletionCallback = base::Closure; |
27 | 27 |
28 bool ShouldAttachNavigationThrottle(); | |
oshima
2016/07/20 21:53:31
please document this
Charlie Harrison
2016/07/21 14:15:22
Done.
| |
29 | |
28 // Checks if session is already merged. This is safe to call on all threads. | 30 // Checks if session is already merged. This is safe to call on all threads. |
29 bool AreAllSessionMergedAlready(); | 31 bool AreAllSessionMergedAlready(); |
30 | 32 |
31 // Adds/removes |profile| to/from the blocking profiles set. This should be | 33 // Adds/removes |profile| to/from the blocking profiles set. This should be |
32 // called on the UI thread. | 34 // called on the UI thread. |
33 void BlockProfile(Profile* profile); | 35 void BlockProfile(Profile* profile); |
34 void UnblockProfile(Profile* profile); | 36 void UnblockProfile(Profile* profile); |
35 | 37 |
36 // Whether requests from |web_contents| or |profile| should currently be | 38 // Whether requests from |web_contents| or |profile| should currently be |
37 // delayed. This should be called on the UI thread. | 39 // delayed. This should be called on the UI thread. |
38 bool ShouldDelayRequestForProfile(Profile* profile); | 40 bool ShouldDelayRequestForProfile(Profile* profile); |
39 bool ShouldDelayRequestForWebContents(content::WebContents* web_contents); | 41 bool ShouldDelayRequestForWebContents(content::WebContents* web_contents); |
40 | 42 |
41 // True if the load of |url| should be delayed. The function is safe to be | 43 // True if the load of |url| should be delayed. The function is safe to be |
42 // called on any thread. | 44 // called on any thread. |
43 bool ShouldDelayUrl(const GURL& url); | 45 bool ShouldDelayUrl(const GURL& url); |
44 | 46 |
45 } // namespace merge_session_throttling_utils | 47 } // namespace merge_session_throttling_utils |
46 | 48 |
47 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_THROTTLING_UTILS_H _ | 49 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_MERGE_SESSION_THROTTLING_UTILS_H _ |
OLD | NEW |