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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system.cc

Issue 9582037: Make document service an interface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Review changes Created 8 years, 9 months 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
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/chromeos/gdata/gdata_file_system.h" 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 401
402 // Should be created from the file browser extension API on UI thread. 402 // Should be created from the file browser extension API on UI thread.
403 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 403 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
404 } 404 }
405 405
406 GDataFileSystem::~GDataFileSystem() { 406 GDataFileSystem::~GDataFileSystem() {
407 // Should be deleted as part of Profile on UI thread. 407 // Should be deleted as part of Profile on UI thread.
408 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 408 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
409 } 409 }
410 410
411 void GDataFileSystem::ReplaceDocumentsService(
412 scoped_ptr<DocumentsServiceInterface> documents_service) {
413 documents_service_->CancelAll();
414 documents_service_.reset(documents_service.release());
415 documents_service_->Initialize(profile_);
416 }
417
411 void GDataFileSystem::Shutdown() { 418 void GDataFileSystem::Shutdown() {
412 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 419 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
413 420
414 // Cancel all the in-flight operations. 421 // Cancel all the in-flight operations.
415 // This asynchronously cancels the URL fetch operations. 422 // This asynchronously cancels the URL fetch operations.
416 documents_service_->CancelAll(); 423 documents_service_->CancelAll();
417 } 424 }
418 425
419 void GDataFileSystem::Authenticate(const AuthStatusCallback& callback) { 426 void GDataFileSystem::Authenticate(const AuthStatusCallback& callback) {
420 // TokenFetcher, used in DocumentsService, must be run on UI thread. 427 // TokenFetcher, used in DocumentsService, must be run on UI thread.
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 1014
1008 GDataFileSystemFactory::~GDataFileSystemFactory() { 1015 GDataFileSystemFactory::~GDataFileSystemFactory() {
1009 } 1016 }
1010 1017
1011 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( 1018 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor(
1012 Profile* profile) const { 1019 Profile* profile) const {
1013 return new GDataFileSystem(profile); 1020 return new GDataFileSystem(profile);
1014 } 1021 }
1015 1022
1016 } // namespace gdata 1023 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698