Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.h

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 const std::string& email, 97 const std::string& email,
98 const std::string& password, 98 const std::string& password,
99 const std::string& refresh_token, 99 const std::string& refresh_token,
100 StartSyncMode start_mode, 100 StartSyncMode start_mode,
101 content::WebContents* web_contents, 101 content::WebContents* web_contents,
102 ConfirmationRequired display_confirmation, 102 ConfirmationRequired display_confirmation,
103 const GURL& continue_url, 103 const GURL& continue_url,
104 Callback callback); 104 Callback callback);
105 105
106 // chrome::BrowserListObserver override. 106 // chrome::BrowserListObserver override.
107 virtual void OnBrowserRemoved(Browser* browser) override; 107 void OnBrowserRemoved(Browser* browser) override;
108 108
109 // If the |browser| argument is non-null, returns the pointer directly. 109 // If the |browser| argument is non-null, returns the pointer directly.
110 // Otherwise creates a new browser for the given profile on the given 110 // Otherwise creates a new browser for the given profile on the given
111 // desktop, adds an empty tab and makes sure the browser is visible. 111 // desktop, adds an empty tab and makes sure the browser is visible.
112 static Browser* EnsureBrowser(Browser* browser, 112 static Browser* EnsureBrowser(Browser* browser,
113 Profile* profile, 113 Profile* profile,
114 chrome::HostDesktopType desktop_type); 114 chrome::HostDesktopType desktop_type);
115 115
116 private: 116 private:
117 friend class OneClickSigninSyncStarterTest; 117 friend class OneClickSigninSyncStarterTest;
118 FRIEND_TEST_ALL_PREFIXES(OneClickSigninSyncStarterTest, CallbackSigninFailed); 118 FRIEND_TEST_ALL_PREFIXES(OneClickSigninSyncStarterTest, CallbackSigninFailed);
119 FRIEND_TEST_ALL_PREFIXES(OneClickSigninSyncStarterTest, CallbackNull); 119 FRIEND_TEST_ALL_PREFIXES(OneClickSigninSyncStarterTest, CallbackNull);
120 FRIEND_TEST_ALL_PREFIXES(OneClickSigninSyncStarterTest, LoadContinueUrl); 120 FRIEND_TEST_ALL_PREFIXES(OneClickSigninSyncStarterTest, LoadContinueUrl);
121 121
122 virtual ~OneClickSigninSyncStarter(); 122 ~OneClickSigninSyncStarter() override;
123 123
124 // Initializes the internals of the OneClickSigninSyncStarter object. Can also 124 // Initializes the internals of the OneClickSigninSyncStarter object. Can also
125 // be used to re-initialize the object to refer to a newly created profile. 125 // be used to re-initialize the object to refer to a newly created profile.
126 void Initialize(Profile* profile, Browser* browser); 126 void Initialize(Profile* profile, Browser* browser);
127 127
128 // SigninTracker::Observer override. 128 // SigninTracker::Observer override.
129 virtual void SigninFailed(const GoogleServiceAuthError& error) override; 129 void SigninFailed(const GoogleServiceAuthError& error) override;
130 virtual void SigninSuccess() override; 130 void SigninSuccess() override;
131 virtual void MergeSessionComplete( 131 void MergeSessionComplete(const GoogleServiceAuthError& error) override;
132 const GoogleServiceAuthError& error) override;
133 132
134 // LoginUIService::Observer override. 133 // LoginUIService::Observer override.
135 virtual void OnSyncConfirmationUIClosed(bool configure_sync_first) override; 134 void OnSyncConfirmationUIClosed(bool configure_sync_first) override;
136 135
137 #if defined(ENABLE_CONFIGURATION_POLICY) 136 #if defined(ENABLE_CONFIGURATION_POLICY)
138 // User input handler for the signin confirmation dialog. 137 // User input handler for the signin confirmation dialog.
139 class SigninDialogDelegate 138 class SigninDialogDelegate
140 : public ui::ProfileSigninConfirmationDelegate { 139 : public ui::ProfileSigninConfirmationDelegate {
141 public: 140 public:
142 SigninDialogDelegate( 141 SigninDialogDelegate(
143 base::WeakPtr<OneClickSigninSyncStarter> sync_starter); 142 base::WeakPtr<OneClickSigninSyncStarter> sync_starter);
144 virtual ~SigninDialogDelegate(); 143 virtual ~SigninDialogDelegate();
145 virtual void OnCancelSignin() override; 144 void OnCancelSignin() override;
146 virtual void OnContinueSignin() override; 145 void OnContinueSignin() override;
147 virtual void OnSigninWithNewProfile() override; 146 void OnSigninWithNewProfile() override;
147
148 private: 148 private:
149 base::WeakPtr<OneClickSigninSyncStarter> sync_starter_; 149 base::WeakPtr<OneClickSigninSyncStarter> sync_starter_;
150 }; 150 };
151 friend class SigninDialogDelegate; 151 friend class SigninDialogDelegate;
152 152
153 // Callback invoked once policy registration is complete. If registration 153 // Callback invoked once policy registration is complete. If registration
154 // fails, |dm_token| and |client_id| will be empty. 154 // fails, |dm_token| and |client_id| will be empty.
155 void OnRegisteredForPolicy(const std::string& dm_token, 155 void OnRegisteredForPolicy(const std::string& dm_token,
156 const std::string& client_id); 156 const std::string& client_id);
157 157
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 std::string client_id_; 237 std::string client_id_;
238 #endif 238 #endif
239 239
240 base::WeakPtrFactory<OneClickSigninSyncStarter> weak_pointer_factory_; 240 base::WeakPtrFactory<OneClickSigninSyncStarter> weak_pointer_factory_;
241 241
242 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncStarter); 242 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncStarter);
243 }; 243 };
244 244
245 245
246 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ 246 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698