| Index: chrome/browser/ui/sync/one_click_signin_sync_observer.h
|
| diff --git a/chrome/browser/ui/sync/one_click_signin_sync_observer.h b/chrome/browser/ui/sync/one_click_signin_sync_observer.h
|
| index 6bf3c02491f66e07bfb724415c77416fbc30fb9e..9b922f8d91fc4d45a06ebef718944db80aba7a38 100644
|
| --- a/chrome/browser/ui/sync/one_click_signin_sync_observer.h
|
| +++ b/chrome/browser/ui/sync/one_click_signin_sync_observer.h
|
| @@ -7,6 +7,8 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/ui/browser.h"
|
| #include "components/sync_driver/sync_service_observer.h"
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "url/gurl.h"
|
| @@ -20,10 +22,16 @@ class WebContents;
|
| class OneClickSigninSyncObserver : public content::WebContentsObserver,
|
| public sync_driver::SyncServiceObserver {
|
| public:
|
| - // Waits for Sync to be initialized, then navigates the |web_contents| to the
|
| - // |continue_url|. Instances of this class delete themselves once the job is
|
| - // done.
|
| + // Waits for the Sync for the |profile| to be initialized, then navigates the
|
| + // |web_contents| to the |continue_url| or opens |activity_controls_url| in
|
| + // a new browser tab depending on which one is provided. Instances of
|
| + // this class delete themselves once the job is done. |web_contents| may be
|
| + // NULL if only |activity_controls_url| is provided. Similarly |browser| may
|
| + // be NULL if only |continue_url| is provided.
|
| OneClickSigninSyncObserver(content::WebContents* web_contents,
|
| + Profile* profile,
|
| + Browser* browser,
|
| + const GURL& activity_controls_url,
|
| const GURL& continue_url);
|
|
|
| protected:
|
| @@ -40,14 +48,21 @@ class OneClickSigninSyncObserver : public content::WebContentsObserver,
|
| // Loads the |continue_url_| in the |web_contents()|.
|
| void LoadContinueUrl();
|
|
|
| - // Returns the ProfileSyncService associated with the |web_contents|.
|
| + // Returns the ProfileSyncService associated with the profile.
|
| // The returned value may be NULL.
|
| - ProfileSyncService* GetSyncService(content::WebContents* web_contents);
|
| + ProfileSyncService* GetSyncService();
|
|
|
| // Deletes the |observer|. Intended to be used as a callback for base::Bind.
|
| static void DeleteObserver(
|
| base::WeakPtr<OneClickSigninSyncObserver> observer);
|
|
|
| + Profile* profile_; // Weak pointer.
|
| +
|
| + Browser* browser_; // Weak pointer.
|
| +
|
| + // The URL of the 'Activity controls' section of the privacy settings page.
|
| + const GURL activity_controls_url_;
|
| +
|
| // The URL to redirect to once Sync is initialized.
|
| const GURL continue_url_;
|
|
|
|
|