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_SYNC_STARTER_H_ | 5 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ |
6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ | 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 }; | 71 }; |
72 | 72 |
73 typedef base::Callback<void(SyncSetupResult)> Callback; | 73 typedef base::Callback<void(SyncSetupResult)> Callback; |
74 | 74 |
75 // |profile| must not be NULL, however |browser| can be. When using the | 75 // |profile| must not be NULL, however |browser| can be. When using the |
76 // OneClickSigninSyncStarter from a browser, provide both. | 76 // OneClickSigninSyncStarter from a browser, provide both. |
77 // If |display_confirmation| is true, the user will be prompted to confirm the | 77 // If |display_confirmation| is true, the user will be prompted to confirm the |
78 // signin before signin completes. | 78 // signin before signin completes. |
79 // |web_contents| is used to show the sync UI if it's showing a blank page | 79 // |web_contents| is used to show the sync UI if it's showing a blank page |
80 // and not about to be closed. It can be NULL. | 80 // and not about to be closed. It can be NULL. |
| 81 // If |web_contents| is non-NULL and the |continue_url| is non-empty, the |
| 82 // |web_contents| will be navigated to the |continue_url| once both signin and |
| 83 // Sync setup are complete. |
81 // |callback| is always executed before OneClickSigninSyncStarter is deleted. | 84 // |callback| is always executed before OneClickSigninSyncStarter is deleted. |
82 // It can be empty. | 85 // It can be empty. |
83 OneClickSigninSyncStarter(Profile* profile, | 86 OneClickSigninSyncStarter(Profile* profile, |
84 Browser* browser, | 87 Browser* browser, |
85 const std::string& email, | 88 const std::string& email, |
86 const std::string& password, | 89 const std::string& password, |
87 const std::string& refresh_token, | 90 const std::string& refresh_token, |
88 StartSyncMode start_mode, | 91 StartSyncMode start_mode, |
89 content::WebContents* web_contents, | 92 content::WebContents* web_contents, |
90 ConfirmationRequired display_confirmation, | 93 ConfirmationRequired display_confirmation, |
| 94 const GURL& continue_url, |
91 Callback callback); | 95 Callback callback); |
92 | 96 |
93 // chrome::BrowserListObserver override. | 97 // chrome::BrowserListObserver override. |
94 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; | 98 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; |
95 | 99 |
96 // If the |browser| argument is non-null, returns the pointer directly. | 100 // If the |browser| argument is non-null, returns the pointer directly. |
97 // Otherwise creates a new browser for the given profile on the given | 101 // Otherwise creates a new browser for the given profile on the given |
98 // desktop, adds an empty tab and makes sure the browser is visible. | 102 // desktop, adds an empty tab and makes sure the browser is visible. |
99 static Browser* EnsureBrowser(Browser* browser, | 103 static Browser* EnsureBrowser(Browser* browser, |
100 Profile* profile, | 104 Profile* profile, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // the default "You are signed in" message is displayed. | 206 // the default "You are signed in" message is displayed. |
203 void DisplayFinalConfirmationBubble(const base::string16& custom_message); | 207 void DisplayFinalConfirmationBubble(const base::string16& custom_message); |
204 | 208 |
205 Profile* profile_; | 209 Profile* profile_; |
206 Browser* browser_; | 210 Browser* browser_; |
207 scoped_ptr<SigninTracker> signin_tracker_; | 211 scoped_ptr<SigninTracker> signin_tracker_; |
208 StartSyncMode start_mode_; | 212 StartSyncMode start_mode_; |
209 chrome::HostDesktopType desktop_type_; | 213 chrome::HostDesktopType desktop_type_; |
210 bool force_same_tab_navigation_; | 214 bool force_same_tab_navigation_; |
211 ConfirmationRequired confirmation_required_; | 215 ConfirmationRequired confirmation_required_; |
| 216 GURL continue_url_; |
212 | 217 |
213 // Callback executed when sync setup succeeds or fails. | 218 // Callback executed when sync setup succeeds or fails. |
214 Callback sync_setup_completed_callback_; | 219 Callback sync_setup_completed_callback_; |
215 | 220 |
216 #if defined(ENABLE_CONFIGURATION_POLICY) | 221 #if defined(ENABLE_CONFIGURATION_POLICY) |
217 // Policy credentials we keep while determining whether to create | 222 // Policy credentials we keep while determining whether to create |
218 // a new profile for an enterprise user or not. | 223 // a new profile for an enterprise user or not. |
219 std::string dm_token_; | 224 std::string dm_token_; |
220 std::string client_id_; | 225 std::string client_id_; |
221 #endif | 226 #endif |
222 | 227 |
223 base::WeakPtrFactory<OneClickSigninSyncStarter> weak_pointer_factory_; | 228 base::WeakPtrFactory<OneClickSigninSyncStarter> weak_pointer_factory_; |
224 | 229 |
225 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncStarter); | 230 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncStarter); |
226 }; | 231 }; |
227 | 232 |
228 | 233 |
229 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ | 234 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ |
OLD | NEW |