| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 return base::StringPrintf("%s-%s %s (%s)", | 91 return base::StringPrintf("%s-%s %s (%s)", |
| 92 kDriveClientName, | 92 kDriveClientName, |
| 93 version.c_str(), | 93 version.c_str(), |
| 94 kLibraryInfo, | 94 kLibraryInfo, |
| 95 os_cpu_info.c_str()); | 95 os_cpu_info.c_str()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace | 98 } // namespace |
| 99 | 99 |
| 100 void DriveSystemService::DriveCacheDeleter::operator()( | |
| 101 DriveCache* cache) const { | |
| 102 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
| 103 if (cache) | |
| 104 cache->Destroy(); | |
| 105 } | |
| 106 | |
| 107 DriveSystemService::DriveSystemService( | 100 DriveSystemService::DriveSystemService( |
| 108 Profile* profile, | 101 Profile* profile, |
| 109 google_apis::DriveServiceInterface* test_drive_service, | 102 google_apis::DriveServiceInterface* test_drive_service, |
| 110 const base::FilePath& test_cache_root, | 103 const base::FilePath& test_cache_root, |
| 111 DriveFileSystemInterface* test_file_system) | 104 DriveFileSystemInterface* test_file_system) |
| 112 : profile_(profile), | 105 : profile_(profile), |
| 113 drive_disabled_(false), | 106 drive_disabled_(false), |
| 114 push_notification_registered_(false), | 107 push_notification_registered_(false), |
| 115 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 108 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
| 116 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 if (factory_for_test_.is_null()) | 409 if (factory_for_test_.is_null()) |
| 417 service = new DriveSystemService(profile, NULL, base::FilePath(), NULL); | 410 service = new DriveSystemService(profile, NULL, base::FilePath(), NULL); |
| 418 else | 411 else |
| 419 service = factory_for_test_.Run(profile); | 412 service = factory_for_test_.Run(profile); |
| 420 | 413 |
| 421 service->Initialize(); | 414 service->Initialize(); |
| 422 return service; | 415 return service; |
| 423 } | 416 } |
| 424 | 417 |
| 425 } // namespace drive | 418 } // namespace drive |
| OLD | NEW |