diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-15 03:04:47 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-15 03:04:47 +0000 |
commit | d416af9310fdd6ab0c441ef15facaf1785eb5391 (patch) | |
tree | 520fbd751584f5705b9c0c51a748f5cfaf496f2a /chrome/browser/drive/drive_app_registry.h | |
parent | a7437a799a6baabdc040fac48dcf9e839fd4dbda (diff) | |
download | chromium_src-d416af9310fdd6ab0c441ef15facaf1785eb5391.zip chromium_src-d416af9310fdd6ab0c441ef15facaf1785eb5391.tar.gz chromium_src-d416af9310fdd6ab0c441ef15facaf1785eb5391.tar.bz2 |
Implement DriveAppRegistry::UninstallApp() and GetAppList().
BUG=324166
First Commit: https://src.chromium.org/viewvc/chrome?view=rev&revision=244182
Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=244189
R=hashimoto@chromium.org
Review URL: https://codereview.chromium.org/133123004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244824 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 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/drive/drive_app_registry.h b/chrome/browser/drive/drive_app_registry.h index cb15dc1..dd53bae 100644 --- a/chrome/browser/drive/drive_app_registry.h +++ b/chrome/browser/drive/drive_app_registry.h @@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/callback_forward.h" #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" @@ -51,6 +52,9 @@ struct DriveAppInfo { GURL create_url; }; +// Callback type for UninstallApp(). +typedef base::Callback<void(google_apis::GDataErrorCode)> UninstallCallback; + // Keeps the track of installed drive applications in-memory. class DriveAppRegistry { public: @@ -63,6 +67,19 @@ class DriveAppRegistry { const std::string& mime_type, std::vector<DriveAppInfo>* apps) const; + // Returns the list of all Drive apps installed. + void GetAppList(std::vector<DriveAppInfo>* apps) const; + + // Uninstalls the app specified by |app_id|. This method sends requests to the + // remote server, and returns the result to |callback| asynchronously. + // |callback| must not be null. + void UninstallApp(const std::string& app_id, + const UninstallCallback& callback); + + // Checks whether UinstallApp is supported. The feature is available only for + // clients with whitelisted API keys (like Official Google Chrome build). + static bool IsAppUninstallSupported(); + // Updates this registry by fetching the data from the server. void Update(); @@ -75,6 +92,11 @@ class DriveAppRegistry { void UpdateAfterGetAppList(google_apis::GDataErrorCode gdata_error, scoped_ptr<google_apis::AppList> app_list); + // Part of UninstallApp(). Receives the response from the server. + void OnAppUninstalled(const std::string& app_id, + const UninstallCallback& callback, + google_apis::GDataErrorCode error); + // Map of application id to each app's info. std::map<std::string, DriveAppInfo> all_apps_; |