| Index: components/login/screens/screen_context.h
|
| diff --git a/components/login/screens/screen_context.h b/components/login/screens/screen_context.h
|
| index 6de612fbe1bd0b3e8d2c1d3ba029983f0d7055e2..bfbba12551b9cb363469886240ea33354af78876 100644
|
| --- a/components/login/screens/screen_context.h
|
| +++ b/components/login/screens/screen_context.h
|
| @@ -9,9 +9,13 @@
|
| #include <vector>
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/callback.h"
|
| +#include "base/callback_list.h"
|
| +#include "base/containers/hash_tables.h"
|
| #include "base/containers/hash_tables.h"
|
| #include "base/logging.h"
|
| #include "base/memory/linked_ptr.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| #include "base/strings/string16.h"
|
| #include "base/threading/non_thread_safe.h"
|
| #include "base/values.h"
|
| @@ -37,6 +41,10 @@ class LOGIN_EXPORT ScreenContext : public base::NonThreadSafe {
|
| public:
|
| typedef std::string KeyType;
|
| typedef base::Value ValueType;
|
| + typedef base::Callback<void(const KeyType& key, const base::Value& value)>
|
| + KeyObserver;
|
| + typedef base::CallbackList<KeyObserver::RunType> KeyObserversList;
|
| + typedef KeyObserversList::Subscription KeyObserverSubscription;
|
|
|
| ScreenContext();
|
| ~ScreenContext();
|
| @@ -68,6 +76,10 @@ class LOGIN_EXPORT ScreenContext : public base::NonThreadSafe {
|
| String16List GetString16List(const KeyType& key,
|
| const String16List& default_value) const;
|
|
|
| + scoped_ptr<KeyObserverSubscription> AddKeyObserver(
|
| + const KeyType& key,
|
| + const KeyObserver& observer);
|
| +
|
| // Returns true if context has |key|.
|
| bool HasKey(const KeyType& key) const;
|
|
|
| @@ -119,6 +131,8 @@ class LOGIN_EXPORT ScreenContext : public base::NonThreadSafe {
|
| // Contains all pending changes.
|
| base::DictionaryValue changes_;
|
|
|
| + base::hash_map<KeyType, linked_ptr<KeyObserversList>> key_observers_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ScreenContext);
|
| };
|
|
|
|
|