| OLD | NEW |
| 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/drive/drive_system_service.h" | 5 #include "chrome/browser/chromeos/drive/drive_system_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 return true; | 212 return true; |
| 213 } | 213 } |
| 214 | 214 |
| 215 void DriveSystemService::ClearCacheAndRemountFileSystem( | 215 void DriveSystemService::ClearCacheAndRemountFileSystem( |
| 216 const base::Callback<void(bool)>& callback) { | 216 const base::Callback<void(bool)>& callback) { |
| 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 218 DCHECK(!callback.is_null()); | 218 DCHECK(!callback.is_null()); |
| 219 | 219 |
| 220 RemoveDriveMountPoint(); | 220 RemoveDriveMountPoint(); |
| 221 cache_->ClearAll(base::Bind( | 221 cache_->ClearAllOnUIThread(base::Bind( |
| 222 &DriveSystemService::ReinitializeResourceMetadataAfterClearCache, | 222 &DriveSystemService::ReinitializeResourceMetadataAfterClearCache, |
| 223 weak_ptr_factory_.GetWeakPtr(), | 223 weak_ptr_factory_.GetWeakPtr(), |
| 224 callback)); | 224 callback)); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void DriveSystemService::ReinitializeResourceMetadataAfterClearCache( | 227 void DriveSystemService::ReinitializeResourceMetadataAfterClearCache( |
| 228 const base::Callback<void(bool)>& callback, | 228 const base::Callback<void(bool)>& callback, |
| 229 bool success) { | 229 bool success) { |
| 230 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 230 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 231 DCHECK(!callback.is_null()); | 231 DCHECK(!callback.is_null()); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 if (factory_for_test_.is_null()) | 439 if (factory_for_test_.is_null()) |
| 440 service = new DriveSystemService(profile, NULL, base::FilePath(), NULL); | 440 service = new DriveSystemService(profile, NULL, base::FilePath(), NULL); |
| 441 else | 441 else |
| 442 service = factory_for_test_.Run(profile); | 442 service = factory_for_test_.Run(profile); |
| 443 | 443 |
| 444 service->Initialize(); | 444 service->Initialize(); |
| 445 return service; | 445 return service; |
| 446 } | 446 } |
| 447 | 447 |
| 448 } // namespace drive | 448 } // namespace drive |
| OLD | NEW |