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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/signin/signin_tracker.h" | 12 #include "chrome/browser/signin/signin_tracker.h" |
13 #include "chrome/browser/ui/browser_list_observer.h" | 13 #include "chrome/browser/ui/browser_list_observer.h" |
14 #include "chrome/browser/ui/host_desktop.h" | 14 #include "chrome/browser/ui/host_desktop.h" |
15 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" | 15 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" |
| 16 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
16 | 17 |
17 class Browser; | 18 class Browser; |
18 class ProfileSyncService; | 19 class ProfileSyncService; |
19 | 20 |
20 namespace policy { | 21 namespace policy { |
21 class CloudPolicyClient; | 22 class CloudPolicyClient; |
22 } | 23 } |
23 | 24 |
24 // Waits for successful singin notification from the signin manager and then | 25 // Waits for successful singin notification from the signin manager and then |
25 // starts the sync machine. Instances of this class delete themselves once | 26 // starts the sync machine. Instances of this class delete themselves once |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // OneClickSigninSyncStarter from a browser, provide both. | 59 // OneClickSigninSyncStarter from a browser, provide both. |
59 // If |display_confirmation| is true, the user will be prompted to confirm the | 60 // If |display_confirmation| is true, the user will be prompted to confirm the |
60 // signin before signin completes. | 61 // signin before signin completes. |
61 OneClickSigninSyncStarter(Profile* profile, | 62 OneClickSigninSyncStarter(Profile* profile, |
62 Browser* browser, | 63 Browser* browser, |
63 const std::string& session_index, | 64 const std::string& session_index, |
64 const std::string& email, | 65 const std::string& email, |
65 const std::string& password, | 66 const std::string& password, |
66 StartSyncMode start_mode, | 67 StartSyncMode start_mode, |
67 bool force_same_tab_navigation, | 68 bool force_same_tab_navigation, |
68 ConfirmationRequired display_confirmation); | 69 ConfirmationRequired display_confirmation, |
| 70 SyncPromoUI::Source source); |
69 | 71 |
70 // chrome::BrowserListObserver override. | 72 // chrome::BrowserListObserver override. |
71 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; | 73 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; |
72 | 74 |
73 private: | 75 private: |
74 virtual ~OneClickSigninSyncStarter(); | 76 virtual ~OneClickSigninSyncStarter(); |
75 | 77 |
76 // Initializes the internals of the OneClickSigninSyncStarter object. Can also | 78 // Initializes the internals of the OneClickSigninSyncStarter object. Can also |
77 // be used to re-initialize the object to refer to a newly created profile. | 79 // be used to re-initialize the object to refer to a newly created profile. |
78 void Initialize(Profile* profile, Browser* browser); | 80 void Initialize(Profile* profile, Browser* browser); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // part of the signin process. | 160 // part of the signin process. |
159 void EnsureBrowser(); | 161 void EnsureBrowser(); |
160 | 162 |
161 Profile* profile_; | 163 Profile* profile_; |
162 Browser* browser_; | 164 Browser* browser_; |
163 scoped_ptr<SigninTracker> signin_tracker_; | 165 scoped_ptr<SigninTracker> signin_tracker_; |
164 StartSyncMode start_mode_; | 166 StartSyncMode start_mode_; |
165 chrome::HostDesktopType desktop_type_; | 167 chrome::HostDesktopType desktop_type_; |
166 bool force_same_tab_navigation_; | 168 bool force_same_tab_navigation_; |
167 ConfirmationRequired confirmation_required_; | 169 ConfirmationRequired confirmation_required_; |
| 170 SyncPromoUI::Source source_; |
168 base::WeakPtrFactory<OneClickSigninSyncStarter> weak_pointer_factory_; | 171 base::WeakPtrFactory<OneClickSigninSyncStarter> weak_pointer_factory_; |
169 | 172 |
170 #if defined(ENABLE_CONFIGURATION_POLICY) | 173 #if defined(ENABLE_CONFIGURATION_POLICY) |
171 // CloudPolicyClient reference we keep while determining whether to create | 174 // CloudPolicyClient reference we keep while determining whether to create |
172 // a new profile for an enterprise user or not. | 175 // a new profile for an enterprise user or not. |
173 scoped_ptr<policy::CloudPolicyClient> policy_client_; | 176 scoped_ptr<policy::CloudPolicyClient> policy_client_; |
174 #endif | 177 #endif |
175 | 178 |
176 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncStarter); | 179 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncStarter); |
177 }; | 180 }; |
178 | 181 |
179 | 182 |
180 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ | 183 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ |
OLD | NEW |