Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: chrome/browser/google_apis/gdata_wapi_service.cc

Issue 11417109: google_apis: Inject the base WAPI server URL to GDataWapiService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/google_apis/gdata_wapi_service.h" 5 #include "chrome/browser/google_apis/gdata_wapi_service.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 // OAuth2 scopes for the documents API. 61 // OAuth2 scopes for the documents API.
62 const char kDocsListScope[] = "https://docs.google.com/feeds/"; 62 const char kDocsListScope[] = "https://docs.google.com/feeds/";
63 const char kSpreadsheetsScope[] = "https://spreadsheets.google.com/feeds/"; 63 const char kSpreadsheetsScope[] = "https://spreadsheets.google.com/feeds/";
64 const char kUserContentScope[] = "https://docs.googleusercontent.com/"; 64 const char kUserContentScope[] = "https://docs.googleusercontent.com/";
65 const char kDriveAppsScope[] = "https://www.googleapis.com/auth/drive.apps"; 65 const char kDriveAppsScope[] = "https://www.googleapis.com/auth/drive.apps";
66 66
67 } // namespace 67 } // namespace
68 68
69 GDataWapiService::GDataWapiService() 69 GDataWapiService::GDataWapiService(const GURL& base_url)
70 : runner_(NULL), 70 : runner_(NULL),
71 // TODO(satorux): The base URL should be injected. 71 url_generator_(base_url) {
72 url_generator_(GURL(GDataWapiUrlGenerator::kBaseUrlForProduction)) {
73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 72 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
74 } 73 }
75 74
76 GDataWapiService::~GDataWapiService() { 75 GDataWapiService::~GDataWapiService() {
77 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 76 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
78 if (runner_.get()) { 77 if (runner_.get()) {
79 runner_->operation_registry()->RemoveObserver(this); 78 runner_->operation_registry()->RemoveObserver(this);
80 runner_->auth_service()->RemoveObserver(this); 79 runner_->auth_service()->RemoveObserver(this);
81 } 80 }
82 } 81 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 DriveServiceObserver, observers_, OnProgressUpdate(list)); 364 DriveServiceObserver, observers_, OnProgressUpdate(list));
366 } 365 }
367 366
368 void GDataWapiService::OnAuthenticationFailed(GDataErrorCode error) { 367 void GDataWapiService::OnAuthenticationFailed(GDataErrorCode error) {
369 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 368 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
370 FOR_EACH_OBSERVER( 369 FOR_EACH_OBSERVER(
371 DriveServiceObserver, observers_, OnAuthenticationFailed(error)); 370 DriveServiceObserver, observers_, OnAuthenticationFailed(error));
372 } 371 }
373 372
374 } // namespace google_apis 373 } // namespace google_apis
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_service.h ('k') | chrome/browser/google_apis/gdata_wapi_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698