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

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_sync_observer.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 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_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_OBSERVER_H_
6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_OBSERVER_H_ 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_OBSERVER_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/sync/profile_sync_service_observer.h" 9 #include "chrome/browser/sync/profile_sync_service_observer.h"
10 #include "content/public/browser/web_contents_observer.h" 10 #include "content/public/browser/web_contents_observer.h"
11 #include "url/gurl.h" 11 #include "url/gurl.h"
12 12
13 class ProfileSyncService; 13 class ProfileSyncService;
14 14
15 namespace content { 15 namespace content {
16 class WebContents; 16 class WebContents;
17 } 17 }
18 18
19 class OneClickSigninSyncObserver : public content::WebContentsObserver, 19 class OneClickSigninSyncObserver : public content::WebContentsObserver,
20 public ProfileSyncServiceObserver { 20 public ProfileSyncServiceObserver {
21 public: 21 public:
22 // Waits for Sync to be initialized, then navigates the |web_contents| to the 22 // Waits for Sync to be initialized, then navigates the |web_contents| to the
23 // |continue_url|. Instances of this class delete themselves once the job is 23 // |continue_url|. Instances of this class delete themselves once the job is
24 // done. 24 // done.
25 OneClickSigninSyncObserver(content::WebContents* web_contents, 25 OneClickSigninSyncObserver(content::WebContents* web_contents,
26 const GURL& continue_url); 26 const GURL& continue_url);
27 27
28 protected: 28 protected:
29 // Exposed for testing. 29 // Exposed for testing.
30 virtual ~OneClickSigninSyncObserver(); 30 ~OneClickSigninSyncObserver() override;
31 31
32 private: 32 private:
33 // content::WebContentsObserver: 33 // content::WebContentsObserver:
34 virtual void WebContentsDestroyed() override; 34 void WebContentsDestroyed() override;
35 35
36 // ProfileSyncServiceObserver: 36 // ProfileSyncServiceObserver:
37 virtual void OnStateChanged() override; 37 void OnStateChanged() override;
38 38
39 // Loads the |continue_url_| in the |web_contents()|. 39 // Loads the |continue_url_| in the |web_contents()|.
40 void LoadContinueUrl(); 40 void LoadContinueUrl();
41 41
42 // Returns the ProfileSyncService associated with the |web_contents|. 42 // Returns the ProfileSyncService associated with the |web_contents|.
43 // The returned value may be NULL. 43 // The returned value may be NULL.
44 ProfileSyncService* GetSyncService(content::WebContents* web_contents); 44 ProfileSyncService* GetSyncService(content::WebContents* web_contents);
45 45
46 // Deletes the |observer|. Intended to be used as a callback for base::Bind. 46 // Deletes the |observer|. Intended to be used as a callback for base::Bind.
47 static void DeleteObserver( 47 static void DeleteObserver(
48 base::WeakPtr<OneClickSigninSyncObserver> observer); 48 base::WeakPtr<OneClickSigninSyncObserver> observer);
49 49
50 // The URL to redirect to once Sync is initialized. 50 // The URL to redirect to once Sync is initialized.
51 const GURL continue_url_; 51 const GURL continue_url_;
52 52
53 base::WeakPtrFactory<OneClickSigninSyncObserver> weak_ptr_factory_; 53 base::WeakPtrFactory<OneClickSigninSyncObserver> weak_ptr_factory_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncObserver); 55 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncObserver);
56 }; 56 };
57 57
58 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_OBSERVER_H_ 58 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698