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

Unified Diff: chrome/browser/chromeos/drive/drive_sync_client.cc

Issue 14348013: Remove legacy in DriveSyncClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix + alpha Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/drive_sync_client.cc
diff --git a/chrome/browser/chromeos/drive/drive_sync_client.cc b/chrome/browser/chromeos/drive/drive_sync_client.cc
index f04c1998b0214298196deed64d0c293d712bfd79..21e6ae3bf14ffa9a8dcc4ed9380ea2d9482626cc 100644
--- a/chrome/browser/chromeos/drive/drive_sync_client.cc
+++ b/chrome/browser/chromeos/drive/drive_sync_client.cc
@@ -4,17 +4,13 @@
#include "chrome/browser/chromeos/drive/drive_sync_client.h"
-#include <algorithm>
#include <vector>
#include "base/bind.h"
#include "base/message_loop_proxy.h"
-#include "base/prefs/pref_change_registrar.h"
-#include "base/prefs/pref_service.h"
#include "chrome/browser/chromeos/drive/drive.pb.h"
+#include "chrome/browser/chromeos/drive/drive_cache.h"
#include "chrome/browser/chromeos/drive/drive_file_system_interface.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
@@ -58,30 +54,25 @@ void CollectBacklog(std::vector<std::string>* to_fetch,
} // namespace
-DriveSyncClient::DriveSyncClient(Profile* profile,
- DriveFileSystemInterface* file_system,
+DriveSyncClient::DriveSyncClient(DriveFileSystemInterface* file_system,
DriveCache* cache)
- : profile_(profile),
- file_system_(file_system),
+ : file_system_(file_system),
cache_(cache),
delay_(base::TimeDelta::FromSeconds(kDelaySeconds)),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-}
+ DCHECK(file_system);
+ DCHECK(cache);
-DriveSyncClient::~DriveSyncClient() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (file_system_)
- file_system_->RemoveObserver(this);
- if (cache_)
- cache_->RemoveObserver(this);
+ file_system_->AddObserver(this);
+ cache_->AddObserver(this);
}
-void DriveSyncClient::Initialize() {
+DriveSyncClient::~DriveSyncClient() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- file_system_->AddObserver(this);
- cache_->AddObserver(this);
+ file_system_->RemoveObserver(this);
+ cache_->RemoveObserver(this);
}
void DriveSyncClient::StartProcessingBacklog() {
« no previous file with comments | « chrome/browser/chromeos/drive/drive_sync_client.h ('k') | chrome/browser/chromeos/drive/drive_sync_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698