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

Unified Diff: chrome/browser/ui/sync/one_click_signin_sync_observer.h

Issue 1806353002: Enhanced Sync Confirmation modal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
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_;

Powered by Google App Engine
This is Rietveld 408576698