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,15 @@ |
| virtual ~LoginUI() {} |
| }; |
| + class Observer { |
|
James Hawkins
2012/07/10 19:25:22
nit: Document class.
Munjal (Google)
2012/07/10 20:36:24
Done.
|
| + public: |
| + virtual ~Observer() { } |
|
James Hawkins
2012/07/10 19:25:22
This is an interface, right? The destructor shoul
James Hawkins
2012/07/10 19:25:22
s/{ }/{}/
Munjal (Google)
2012/07/10 20:36:24
Done.
Munjal (Google)
2012/07/10 20:36:24
Done.
|
| + // Called when a new login UI is shown. |
| + virtual void OnLoginUIShown(LoginUI* ui) = 0; |
|
James Hawkins
2012/07/10 19:25:22
Optional nit: I'd add a newline between methods fo
Munjal (Google)
2012/07/10 20:36:24
Done.
|
| + // Called when a login UI is closed. |
| + virtual void OnLoginUIClosed(LoginUI* ui) = 0; |
| + }; |
| + |
| LoginUIService(); |
| virtual ~LoginUIService(); |
| @@ -37,6 +47,9 @@ |
| return ui_; |
| } |
| + void AddObserver(Observer* observer); |
|
James Hawkins
2012/07/10 19:25:22
nit: Document |observer|.
Munjal (Google)
2012/07/10 20:36:24
Done.
|
| + 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 +67,8 @@ |
| // Weak pointer to the currently active login UI, or null if none. |
| LoginUI* ui_; |
| + ObserverList<Observer> observer_list_; |
|
James Hawkins
2012/07/10 19:25:22
nit: Document member variable.
Munjal (Google)
2012/07/10 20:36:24
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(LoginUIService); |
| }; |