| 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/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 pref_service->SetFilePath( | 558 pref_service->SetFilePath( |
| 559 ::prefs::kDownloadDefaultDirectory, | 559 ::prefs::kDownloadDefaultDirectory, |
| 560 file_manager::util::GetDownloadsFolderForProfile(profile_)); | 560 file_manager::util::GetDownloadsFolderForProfile(profile_)); |
| 561 } | 561 } |
| 562 } | 562 } |
| 563 | 563 |
| 564 void DriveIntegrationService::Observe( | 564 void DriveIntegrationService::Observe( |
| 565 int type, | 565 int type, |
| 566 const content::NotificationSource& source, | 566 const content::NotificationSource& source, |
| 567 const content::NotificationDetails& details) { | 567 const content::NotificationDetails& details) { |
| 568 if (type == chrome::NOTIFICATION_PROFILE_CREATED) { | 568 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CREATED, type); |
| 569 Profile* created_profile = content::Source<Profile>(source).ptr(); | 569 Profile* created_profile = content::Source<Profile>(source).ptr(); |
| 570 if (created_profile->IsOffTheRecord() && | 570 if (created_profile->IsOffTheRecord() && |
| 571 created_profile->IsSameProfile(profile_)) { | 571 created_profile->IsSameProfile(profile_)) { |
| 572 download_handler_->ObserveIncognitoDownloadManager( | 572 download_handler_->ObserveIncognitoDownloadManager( |
| 573 BrowserContext::GetDownloadManager(created_profile)); | 573 BrowserContext::GetDownloadManager(created_profile)); |
| 574 } | |
| 575 } | 574 } |
| 576 } | 575 } |
| 577 | 576 |
| 578 //===================== DriveIntegrationServiceFactory ======================= | 577 //===================== DriveIntegrationServiceFactory ======================= |
| 579 | 578 |
| 580 DriveIntegrationServiceFactory::FactoryCallback* | 579 DriveIntegrationServiceFactory::FactoryCallback* |
| 581 DriveIntegrationServiceFactory::factory_for_test_ = NULL; | 580 DriveIntegrationServiceFactory::factory_for_test_ = NULL; |
| 582 | 581 |
| 583 DriveIntegrationServiceFactory::ScopedFactoryForTest::ScopedFactoryForTest( | 582 DriveIntegrationServiceFactory::ScopedFactoryForTest::ScopedFactoryForTest( |
| 584 FactoryCallback* factory_for_test) { | 583 FactoryCallback* factory_for_test) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 profile, preference_watcher, | 641 profile, preference_watcher, |
| 643 NULL, std::string(), base::FilePath(), NULL); | 642 NULL, std::string(), base::FilePath(), NULL); |
| 644 } else { | 643 } else { |
| 645 service = factory_for_test_->Run(profile); | 644 service = factory_for_test_->Run(profile); |
| 646 } | 645 } |
| 647 | 646 |
| 648 return service; | 647 return service; |
| 649 } | 648 } |
| 650 | 649 |
| 651 } // namespace drive | 650 } // namespace drive |
| OLD | NEW |