Chromium Code Reviews| 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,19 @@ |
| virtual ~LoginUI() {} |
| }; |
| + // Interface for obervers of LoginUIService. |
| + class Observer { |
| + public: |
| + // Called when a new login UI is shown. |
| + virtual void OnLoginUIShown(LoginUI* ui) = 0; |
|
James Hawkins
2012/07/10 20:41:15
nit: Document |ui|, e.g. can it ever be NULL or is
Munjal (Google)
2012/07/10 20:53:59
Done.
|
| + |
| + // Called when a login UI is closed. |
| + virtual void OnLoginUIClosed(LoginUI* ui) = 0; |
| + |
| + protected: |
| + virtual ~Observer() {} |
| + }; |
| + |
| LoginUIService(); |
| virtual ~LoginUIService(); |
| @@ -37,6 +51,10 @@ |
| return ui_; |
| } |
| + // |observer| The observer to add or remove. |
|
James Hawkins
2012/07/10 20:41:15
nit: Must it be non-NULL?
Munjal (Google)
2012/07/10 20:53:59
Done.
|
| + 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 +72,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); |
| }; |