diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-15 14:31:07 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-15 14:31:07 +0000 |
commit | 52daa301c9749eee9d64932db07281d74dd1d4a2 (patch) | |
tree | a2cd6d3ccd7739128b5c8cea9fe456d54dd12b06 /chrome/browser/drive/drive_app_registry.h | |
parent | 070080b9254c952e6ece5959015c7f941003b795 (diff) | |
download | chromium_src-52daa301c9749eee9d64932db07281d74dd1d4a2.zip chromium_src-52daa301c9749eee9d64932db07281d74dd1d4a2.tar.gz chromium_src-52daa301c9749eee9d64932db07281d74dd1d4a2.tar.bz2 |
Add DriveAppRegistryObserver.
So that interested parties get notified when the list of installed
Drive apps are updated.
BUG=358796
Review URL: https://codereview.chromium.org/235983008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263843 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/drive/drive_app_registry.h')
-rw-r--r-- | chrome/browser/drive/drive_app_registry.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/drive/drive_app_registry.h b/chrome/browser/drive/drive_app_registry.h index c86de92..7f8ee0c 100644 --- a/chrome/browser/drive/drive_app_registry.h +++ b/chrome/browser/drive/drive_app_registry.h @@ -13,6 +13,7 @@ #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "base/observer_list.h" #include "google_apis/drive/gdata_errorcode.h" #include "google_apis/drive/gdata_wapi_parser.h" #include "url/gurl.h" @@ -23,6 +24,7 @@ class AppList; namespace drive { +class DriveAppRegistryObserver; class DriveServiceInterface; // Data structure that defines Drive app. See @@ -97,6 +99,9 @@ class DriveAppRegistry { // Updates this registry from the |app_list|. void UpdateFromAppList(const google_apis::AppList& app_list); + void AddObserver(DriveAppRegistryObserver* observer); + void RemoveObserver(DriveAppRegistryObserver* observer); + private: // Part of Update(). Runs upon the completion of fetching the Drive apps // data from the server. @@ -121,9 +126,12 @@ class DriveAppRegistry { bool is_updating_; + ObserverList<DriveAppRegistryObserver> observers_; + // Note: This should remain the last member so it'll be destroyed and // invalidate the weak pointers before any other members are destroyed. base::WeakPtrFactory<DriveAppRegistry> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(DriveAppRegistry); }; |