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

Unified Diff: chrome/browser/ui/webui/signin/sync_confirmation_handler.h

Issue 2784823002: Reland "Use the same browser instance in the sync confirmation dialog. (Closed)
Patch Set: Rebase and fix conflicts Created 3 years, 9 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/webui/signin/sync_confirmation_handler.h
diff --git a/chrome/browser/ui/webui/signin/sync_confirmation_handler.h b/chrome/browser/ui/webui/signin/sync_confirmation_handler.h
index 5792dbc37999fcee1b3d17acb948e9ecf695321e..8953681eb80fb6a5796b90111bc26bb483e66101 100644
--- a/chrome/browser/ui/webui/signin/sync_confirmation_handler.h
+++ b/chrome/browser/ui/webui/signin/sync_confirmation_handler.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/macros.h"
+#include "chrome/browser/ui/browser_list_observer.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "content/public/browser/web_ui_message_handler.h"
@@ -17,9 +18,10 @@ class ListValue;
}
class SyncConfirmationHandler : public content::WebUIMessageHandler,
- public AccountTrackerService::Observer {
+ public AccountTrackerService::Observer,
+ public chrome::BrowserListObserver {
public:
- SyncConfirmationHandler();
+ explicit SyncConfirmationHandler(Browser* browser);
~SyncConfirmationHandler() override;
// content::WebUIMessageHandler:
@@ -28,6 +30,9 @@ class SyncConfirmationHandler : public content::WebUIMessageHandler,
// AccountTrackerService::Observer:
void OnAccountUpdated(const AccountInfo& info) override;
+ // chrome::BrowserListObserver:
+ void OnBrowserRemoved(Browser* browser) override;
+
protected:
// Handles "confirm" message from the page. No arguments.
// This message is sent when the user confirms that they want complete sign in
@@ -60,6 +65,11 @@ class SyncConfirmationHandler : public content::WebUIMessageHandler,
LoginUIService::SyncConfirmationUIClosedResult result);
private:
+ Profile* profile_;
+
+ // Weak reference to the browser that showed the sync confirmation dialog.
+ Browser* browser_;
+
// Records whether the user clicked on Undo, Ok, or Settings.
bool did_user_explicitly_interact;
« no previous file with comments | « chrome/browser/ui/webui/signin/signin_utils.cc ('k') | chrome/browser/ui/webui/signin/sync_confirmation_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698