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

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

Issue 10699013: Add a method to LoginUIService to open the sign in UI in a popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/signin/login_ui_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/signin/login_ui_service.h
===================================================================
--- chrome/browser/ui/webui/signin/login_ui_service.h (revision 145894)
+++ chrome/browser/ui/webui/signin/login_ui_service.h (working copy)
@@ -7,6 +7,7 @@
#pragma once
#include "base/basictypes.h"
+#include "base/observer_list.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
class Browser;
@@ -29,6 +30,21 @@
virtual ~LoginUI() {}
};
+ // Interface for obervers of LoginUIService.
+ class Observer {
+ public:
+ // Called when a new login UI is shown.
+ // |ui| The login UI that was just shown. Will never be null.
+ virtual void OnLoginUIShown(LoginUI* ui) = 0;
+
+ // Called when a login UI is closed.
+ // |ui| The login UI that was just closed; will never be null.
+ virtual void OnLoginUIClosed(LoginUI* ui) = 0;
+
+ protected:
+ virtual ~Observer() {}
+ };
+
LoginUIService();
virtual ~LoginUIService();
@@ -37,6 +53,10 @@
return ui_;
}
+ // |observer| The observer to add or remove; cannot be NULL.
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
// Sets the currently active login UI. It is illegal to call this if there is
// already login UI visible.
void SetLoginUI(LoginUI* ui);
@@ -54,6 +74,9 @@
// Weak pointer to the currently active login UI, or null if none.
LoginUI* ui_;
+ // List of observers.
+ ObserverList<Observer> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(LoginUIService);
};
« no previous file with comments | « no previous file | chrome/browser/ui/webui/signin/login_ui_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698