OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_OBSERVER_H_ | |
6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_OBSERVER_H_ | |
7 | |
8 #include "chrome/browser/sync/profile_sync_service_observer.h" | |
9 #include "content/public/browser/web_contents_observer.h" | |
10 #include "url/gurl.h" | |
11 | |
12 class ProfileSyncService; | |
13 | |
14 namespace content { | |
15 class WebContents; | |
16 } | |
17 | |
18 class OneClickSigninSyncObserver : public content::WebContentsObserver, | |
19 public ProfileSyncServiceObserver { | |
Roger Tawa OOO till Jul 10th
2014/03/31 20:10:38
Oops, hit send too quickly in previous comment. W
Ilya Sherman
2014/04/01 02:00:35
So, there are two ways to interpret this question:
| |
20 public: | |
21 // Waits for Sync to be initialized, then navigates the |web_contents| to the | |
22 // |continue_url|. Instances of this class delete themselves once the job is | |
23 // done. | |
24 OneClickSigninSyncObserver(content::WebContents* web_contents, | |
25 const GURL& continue_url); | |
26 | |
27 protected: | |
28 // Exposed for testing. | |
29 virtual ~OneClickSigninSyncObserver(); | |
30 | |
31 private: | |
32 // content::WebContentsObserver: | |
33 virtual void WebContentsDestroyed(content::WebContents* contents) OVERRIDE; | |
34 | |
35 // ProfileSyncServiceObserver: | |
36 virtual void OnStateChanged() OVERRIDE; | |
37 | |
38 // Loads the |continue_url_| in the |web_contents()|. | |
39 void LoadContinueUrl(); | |
40 | |
41 // Returns the ProfileSyncService associated with the |web_contents|. | |
42 // The returned value may be NULL. | |
43 ProfileSyncService* GetSyncService(content::WebContents* web_contents); | |
44 | |
45 // The URL to redirect to once Sync is initialized. | |
46 const GURL continue_url_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncObserver); | |
49 }; | |
50 | |
51 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_OBSERVER_H_ | |
OLD | NEW |