| 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_integration_service.h" | 5 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 cache_.get(), | 209 cache_.get(), |
| 210 resource_metadata_.get()), | 210 resource_metadata_.get()), |
| 211 base::Bind(&DriveIntegrationService::InitializeAfterMetadataInitialized, | 211 base::Bind(&DriveIntegrationService::InitializeAfterMetadataInitialized, |
| 212 weak_ptr_factory_.GetWeakPtr())); | 212 weak_ptr_factory_.GetWeakPtr())); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void DriveIntegrationService::Shutdown() { | 215 void DriveIntegrationService::Shutdown() { |
| 216 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 216 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 217 | 217 |
| 218 DriveNotificationManager* drive_notification_manager = | 218 DriveNotificationManager* drive_notification_manager = |
| 219 DriveNotificationManagerFactory::GetForProfile(profile_); | 219 DriveNotificationManagerFactory::GetForBrowserContext(profile_); |
| 220 if (drive_notification_manager) | 220 if (drive_notification_manager) |
| 221 drive_notification_manager->RemoveObserver(this); | 221 drive_notification_manager->RemoveObserver(this); |
| 222 | 222 |
| 223 RemoveDriveMountPoint(); | 223 RemoveDriveMountPoint(); |
| 224 debug_info_collector_.reset(); | 224 debug_info_collector_.reset(); |
| 225 download_handler_.reset(); | 225 download_handler_.reset(); |
| 226 file_system_.reset(); | 226 file_system_.reset(); |
| 227 drive_app_registry_.reset(); | 227 drive_app_registry_.reset(); |
| 228 scheduler_.reset(); | 228 scheduler_.reset(); |
| 229 drive_service_.reset(); | 229 drive_service_.reset(); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 content::DownloadManager* download_manager = | 357 content::DownloadManager* download_manager = |
| 358 g_browser_process->download_status_updater() ? | 358 g_browser_process->download_status_updater() ? |
| 359 BrowserContext::GetDownloadManager(profile_) : NULL; | 359 BrowserContext::GetDownloadManager(profile_) : NULL; |
| 360 download_handler_->Initialize( | 360 download_handler_->Initialize( |
| 361 download_manager, | 361 download_manager, |
| 362 cache_root_directory_.Append(util::kTemporaryFileDirectory)); | 362 cache_root_directory_.Append(util::kTemporaryFileDirectory)); |
| 363 | 363 |
| 364 // Register for Google Drive invalidation notifications. | 364 // Register for Google Drive invalidation notifications. |
| 365 DriveNotificationManager* drive_notification_manager = | 365 DriveNotificationManager* drive_notification_manager = |
| 366 DriveNotificationManagerFactory::GetForProfile(profile_); | 366 DriveNotificationManagerFactory::GetForBrowserContext(profile_); |
| 367 if (drive_notification_manager) { | 367 if (drive_notification_manager) { |
| 368 drive_notification_manager->AddObserver(this); | 368 drive_notification_manager->AddObserver(this); |
| 369 const bool registered = | 369 const bool registered = |
| 370 drive_notification_manager->push_notification_registered(); | 370 drive_notification_manager->push_notification_registered(); |
| 371 const char* status = (registered ? "registered" : "not registered"); | 371 const char* status = (registered ? "registered" : "not registered"); |
| 372 util::Log(logging::LOG_INFO, "Push notification is %s", status); | 372 util::Log(logging::LOG_INFO, "Push notification is %s", status); |
| 373 | 373 |
| 374 if (drive_notification_manager->push_notification_enabled()) | 374 if (drive_notification_manager->push_notification_enabled()) |
| 375 drive_app_registry_->Update(); | 375 drive_app_registry_->Update(); |
| 376 } | 376 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 profile, NULL, base::FilePath(), NULL); | 450 profile, NULL, base::FilePath(), NULL); |
| 451 } else { | 451 } else { |
| 452 service = factory_for_test_.Run(profile); | 452 service = factory_for_test_.Run(profile); |
| 453 } | 453 } |
| 454 | 454 |
| 455 service->Initialize(); | 455 service->Initialize(); |
| 456 return service; | 456 return service; |
| 457 } | 457 } |
| 458 | 458 |
| 459 } // namespace drive | 459 } // namespace drive |
| OLD | NEW |