summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/gdata/gdata_wapi_service.cc
diff options
context:
space:
mode:
authorkochi@chromium.org <kochi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 04:34:30 +0000
committerkochi@chromium.org <kochi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 04:34:30 +0000
commit0e42207aafbc166412c7bfc8b1ace2769385878d (patch)
tree3ecde3858efe7c90a7231b78ba2e396035fcd19a /chrome/browser/chromeos/gdata/gdata_wapi_service.cc
parent7a340b9b51d2937c0ea640249fbf80e1f04d82e9 (diff)
downloadchromium_src-0e42207aafbc166412c7bfc8b1ace2769385878d.zip
chromium_src-0e42207aafbc166412c7bfc8b1ace2769385878d.tar.gz
chromium_src-0e42207aafbc166412c7bfc8b1ace2769385878d.tar.bz2
Own OAuth2 scopes in AuthService
Own Oauth2 scopes required for APIs in AuthService so that each service (GData WAPI, Drive V2, Contacts) can have its own scopes. BUG=none TEST=pass all existing tests. Review URL: https://chromiumcodereview.appspot.com/10868066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154072 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/gdata/gdata_wapi_service.cc')
-rw-r--r--chrome/browser/chromeos/gdata/gdata_wapi_service.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_wapi_service.cc b/chrome/browser/chromeos/gdata/gdata_wapi_service.cc
index e63de5c..464f163 100644
--- a/chrome/browser/chromeos/gdata/gdata_wapi_service.cc
+++ b/chrome/browser/chromeos/gdata/gdata_wapi_service.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/gdata/gdata_wapi_service.h"
#include <string>
+#include <vector>
#include "base/bind.h"
#include "base/message_loop_proxy.h"
@@ -57,6 +58,12 @@ const char* GetExportFormatParam(DocumentExportFormat format) {
}
}
+// OAuth2 scopes for the documents API.
+const char kDocsListScope[] = "https://docs.google.com/feeds/";
+const char kSpreadsheetsScope[] = "https://spreadsheets.google.com/feeds/";
+const char kUserContentScope[] = "https://docs.googleusercontent.com/";
+const char kDriveAppsScope[] = "https://www.googleapis.com/auth/drive.apps";
+
} // namespace
GDataWapiService::GDataWapiService()
@@ -76,7 +83,14 @@ AuthService* GDataWapiService::auth_service_for_testing() {
void GDataWapiService::Initialize(Profile* profile) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
profile_ = profile;
- runner_.reset(new OperationRunner(profile));
+
+ std::vector<std::string> scopes;
+ scopes.push_back(kDocsListScope);
+ scopes.push_back(kSpreadsheetsScope);
+ scopes.push_back(kUserContentScope);
+ // Drive App scope is required for even WAPI v3 apps access.
+ scopes.push_back(kDriveAppsScope);
+ runner_.reset(new OperationRunner(profile, scopes));
runner_->Initialize();
}