OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ |
6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ | 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 ProfileIOData* io_data); | 113 ProfileIOData* io_data); |
114 | 114 |
115 // Looks for the Google-Accounts-SignIn response header, and if found, | 115 // Looks for the Google-Accounts-SignIn response header, and if found, |
116 // tries to display an infobar in the tab contents identified by the | 116 // tries to display an infobar in the tab contents identified by the |
117 // child/route id. | 117 // child/route id. |
118 static void ShowInfoBarIfPossible(net::URLRequest* request, | 118 static void ShowInfoBarIfPossible(net::URLRequest* request, |
119 ProfileIOData* io_data, | 119 ProfileIOData* io_data, |
120 int child_id, | 120 int child_id, |
121 int route_id); | 121 int route_id); |
122 | 122 |
| 123 // If the |source| is not settings page/webstore, redirects to |
| 124 // the NTP/Apps page. |
| 125 static void RedirectToNtpOrAppsPageIfNecessary( |
| 126 content::WebContents* contents, signin::Source source); |
| 127 |
| 128 static void ShowSigninErrorBubble(Browser* browser, const std::string& error); |
| 129 |
123 // Remove the item currently at the top of the history list if it's | 130 // Remove the item currently at the top of the history list if it's |
124 // the Gaia redirect URL. Due to limitations of the NavigationController | 131 // the Gaia redirect URL. Due to limitations of the NavigationController |
125 // this cannot be done until a new page becomes "current". | 132 // this cannot be done until a new page becomes "current". |
126 static void RemoveSigninRedirectURLHistoryItem( | 133 static void RemoveSigninRedirectURLHistoryItem( |
127 content::WebContents* web_contents); | 134 content::WebContents* web_contents); |
128 | 135 |
129 static void LogConfirmHistogramValue(int action); | 136 static void LogConfirmHistogramValue(int action); |
130 | 137 |
131 private: | 138 private: |
132 friend class content::WebContentsUserData<OneClickSigninHelper>; | 139 friend class content::WebContentsUserData<OneClickSigninHelper>; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // entered on the Gaia sign in page (for explicit sign ins). | 208 // entered on the Gaia sign in page (for explicit sign ins). |
202 static void ShowInfoBarUIThread(const std::string& session_index, | 209 static void ShowInfoBarUIThread(const std::string& session_index, |
203 const std::string& email, | 210 const std::string& email, |
204 AutoAccept auto_accept, | 211 AutoAccept auto_accept, |
205 signin::Source source, | 212 signin::Source source, |
206 const GURL& continue_url, | 213 const GURL& continue_url, |
207 int child_id, | 214 int child_id, |
208 int route_id); | 215 int route_id); |
209 | 216 |
210 void RedirectToSignin(); | 217 void RedirectToSignin(); |
211 void ShowSigninErrorBubble(Browser* browser, const std::string& error); | |
212 | 218 |
213 // Clear all data member of the helper, except for the error. | 219 // Clear all data member of the helper, except for the error. |
214 void CleanTransientState(); | 220 void CleanTransientState(); |
215 | 221 |
216 // Unitests that use a TestingProfile should call this. | 222 // Unitests that use a TestingProfile should call this. |
217 // Otherwise, clearing the pending e-mail crashes because the code expects | 223 // Otherwise, clearing the pending e-mail crashes because the code expects |
218 // a real ResourceContext rather than the MockResourceContext a | 224 // a real ResourceContext rather than the MockResourceContext a |
219 // TestingProfile provides. | 225 // TestingProfile provides. |
220 void SetDoNotClearPendingEmailForTesting(); | 226 void SetDoNotClearPendingEmailForTesting(); |
221 | 227 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 287 |
282 // Allows unittest to avoid starting sync for real. | 288 // Allows unittest to avoid starting sync for real. |
283 bool do_not_start_sync_for_testing_; | 289 bool do_not_start_sync_for_testing_; |
284 | 290 |
285 base::WeakPtrFactory<OneClickSigninHelper> weak_pointer_factory_; | 291 base::WeakPtrFactory<OneClickSigninHelper> weak_pointer_factory_; |
286 | 292 |
287 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper); | 293 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper); |
288 }; | 294 }; |
289 | 295 |
290 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ | 296 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ |
OLD | NEW |