Chromium Code Reviews| Index: chrome/browser/ui/webui/signin/login_ui_service.h |
| =================================================================== |
| --- chrome/browser/ui/webui/signin/login_ui_service.h (revision 145382) |
| +++ 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,14 @@ |
| virtual ~LoginUI() {} |
| }; |
| + class Observer { |
| + public: |
| + // Called when a new login UI is shown. |
| + virtual void OnLoginUIShown(LoginUI* ui) = 0; |
| + // Called when a login UI is closed. |
| + virtual void OnLoginUIClosed(LoginUI* ui) = 0; |
| + }; |
| + |
| LoginUIService(); |
| virtual ~LoginUIService(); |
| @@ -37,12 +46,17 @@ |
| return ui_; |
| } |
| + void AddObserver(Observer* o); |
|
jam
2012/07/10 16:13:07
nit: Observer* observer
Munjal (Google)
2012/07/10 16:46:15
Done.
|
| + void RemoveObserver(Observer* o); |
| + |
| // Sets the currently active login UI. It is illegal to call this if there is |
| // already login UI visible. |
| + // Fires chrome::NOTIFICATION_LOGIN_UI_CHANGED. |
|
jam
2012/07/10 16:13:07
nit: remove this comment and below
Munjal (Google)
2012/07/10 16:46:15
Done.
|
| void SetLoginUI(LoginUI* ui); |
| // Called when login UI is closed. If the passed UI is the current login UI, |
| // sets current_login_ui() to null. |
| + // Fires chrome::NOTIFICATION_LOGIN_UI_CHANGED. |
| void LoginUIClosed(LoginUI* ui); |
| // Brings the login UI to the foreground, or if there is no login UI, |
| @@ -54,6 +68,8 @@ |
| // Weak pointer to the currently active login UI, or null if none. |
| LoginUI* ui_; |
| + ObserverList<Observer> observer_list_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(LoginUIService); |
| }; |