| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 download_manager_delegate_->SetDownloadManager(dlm); | 331 download_manager_delegate_->SetDownloadManager(dlm); |
| 332 download_manager_.swap(dlm); | 332 download_manager_.swap(dlm); |
| 333 } | 333 } |
| 334 return download_manager_.get(); | 334 return download_manager_.get(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 bool OffTheRecordProfileImpl::HasCreatedDownloadManager() const { | 337 bool OffTheRecordProfileImpl::HasCreatedDownloadManager() const { |
| 338 return download_manager_.get() != NULL; | 338 return download_manager_.get() != NULL; |
| 339 } | 339 } |
| 340 | 340 |
| 341 PersonalDataManager* OffTheRecordProfileImpl::GetPersonalDataManager() { | |
| 342 return NULL; | |
| 343 } | |
| 344 | |
| 345 fileapi::FileSystemContext* OffTheRecordProfileImpl::GetFileSystemContext() { | 341 fileapi::FileSystemContext* OffTheRecordProfileImpl::GetFileSystemContext() { |
| 346 CreateQuotaManagerAndClients(); | 342 CreateQuotaManagerAndClients(); |
| 347 return file_system_context_.get(); | 343 return file_system_context_.get(); |
| 348 } | 344 } |
| 349 | 345 |
| 350 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { | 346 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { |
| 351 return io_data_.GetMainRequestContextGetter(); | 347 return io_data_.GetMainRequestContextGetter(); |
| 352 } | 348 } |
| 353 | 349 |
| 354 quota::QuotaManager* OffTheRecordProfileImpl::GetQuotaManager() { | 350 quota::QuotaManager* OffTheRecordProfileImpl::GetQuotaManager() { |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 | 659 |
| 664 #if defined(OS_CHROMEOS) | 660 #if defined(OS_CHROMEOS) |
| 665 // Special case of the OffTheRecordProfileImpl which is used while Guest | 661 // Special case of the OffTheRecordProfileImpl which is used while Guest |
| 666 // session in CrOS. | 662 // session in CrOS. |
| 667 class GuestSessionProfile : public OffTheRecordProfileImpl { | 663 class GuestSessionProfile : public OffTheRecordProfileImpl { |
| 668 public: | 664 public: |
| 669 explicit GuestSessionProfile(Profile* real_profile) | 665 explicit GuestSessionProfile(Profile* real_profile) |
| 670 : OffTheRecordProfileImpl(real_profile) { | 666 : OffTheRecordProfileImpl(real_profile) { |
| 671 } | 667 } |
| 672 | 668 |
| 673 virtual PersonalDataManager* GetPersonalDataManager() { | |
| 674 return GetOriginalProfile()->GetPersonalDataManager(); | |
| 675 } | |
| 676 | |
| 677 virtual void InitChromeOSPreferences() { | 669 virtual void InitChromeOSPreferences() { |
| 678 chromeos_preferences_.reset(new chromeos::Preferences()); | 670 chromeos_preferences_.reset(new chromeos::Preferences()); |
| 679 chromeos_preferences_->Init(GetPrefs()); | 671 chromeos_preferences_->Init(GetPrefs()); |
| 680 } | 672 } |
| 681 | 673 |
| 682 private: | 674 private: |
| 683 // The guest user should be able to customize Chrome OS preferences. | 675 // The guest user should be able to customize Chrome OS preferences. |
| 684 scoped_ptr<chromeos::Preferences> chromeos_preferences_; | 676 scoped_ptr<chromeos::Preferences> chromeos_preferences_; |
| 685 }; | 677 }; |
| 686 #endif | 678 #endif |
| 687 | 679 |
| 688 Profile* Profile::CreateOffTheRecordProfile() { | 680 Profile* Profile::CreateOffTheRecordProfile() { |
| 689 OffTheRecordProfileImpl* profile = NULL; | 681 OffTheRecordProfileImpl* profile = NULL; |
| 690 #if defined(OS_CHROMEOS) | 682 #if defined(OS_CHROMEOS) |
| 691 if (Profile::IsGuestSession()) | 683 if (Profile::IsGuestSession()) |
| 692 profile = new GuestSessionProfile(this); | 684 profile = new GuestSessionProfile(this); |
| 693 #endif | 685 #endif |
| 694 if (!profile) | 686 if (!profile) |
| 695 profile = new OffTheRecordProfileImpl(this); | 687 profile = new OffTheRecordProfileImpl(this); |
| 696 profile->Init(); | 688 profile->Init(); |
| 697 return profile; | 689 return profile; |
| 698 } | 690 } |
| OLD | NEW |