Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 7967024: Profile shouldn't own PersonalDataManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "chrome/browser/autofill/personal_data_manager_factory.h"
Ilya Sherman 2011/09/23 03:56:34 nit: What relies on this #include?
dhollowa 2011/09/23 16:30:03 Nothing. Removed.
15 #include "chrome/browser/background/background_contents_service_factory.h" 16 #include "chrome/browser/background/background_contents_service_factory.h"
16 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/chrome_plugin_service_filter.h" 18 #include "chrome/browser/chrome_plugin_service_filter.h"
18 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
19 #include "chrome/browser/extensions/extension_info_map.h" 20 #include "chrome/browser/extensions/extension_info_map.h"
20 #include "chrome/browser/extensions/extension_message_service.h" 21 #include "chrome/browser/extensions/extension_message_service.h"
21 #include "chrome/browser/extensions/extension_pref_store.h" 22 #include "chrome/browser/extensions/extension_pref_store.h"
22 #include "chrome/browser/extensions/extension_process_manager.h" 23 #include "chrome/browser/extensions/extension_process_manager.h"
23 #include "chrome/browser/extensions/extension_service.h" 24 #include "chrome/browser/extensions/extension_service.h"
24 #include "chrome/browser/extensions/extension_special_storage_policy.h" 25 #include "chrome/browser/extensions/extension_special_storage_policy.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 download_manager_delegate_->SetDownloadManager(dlm); 332 download_manager_delegate_->SetDownloadManager(dlm);
332 download_manager_.swap(dlm); 333 download_manager_.swap(dlm);
333 } 334 }
334 return download_manager_.get(); 335 return download_manager_.get();
335 } 336 }
336 337
337 bool OffTheRecordProfileImpl::HasCreatedDownloadManager() const { 338 bool OffTheRecordProfileImpl::HasCreatedDownloadManager() const {
338 return download_manager_.get() != NULL; 339 return download_manager_.get() != NULL;
339 } 340 }
340 341
341 PersonalDataManager* OffTheRecordProfileImpl::GetPersonalDataManager() {
342 return NULL;
343 }
344
345 fileapi::FileSystemContext* OffTheRecordProfileImpl::GetFileSystemContext() { 342 fileapi::FileSystemContext* OffTheRecordProfileImpl::GetFileSystemContext() {
346 CreateQuotaManagerAndClients(); 343 CreateQuotaManagerAndClients();
347 return file_system_context_.get(); 344 return file_system_context_.get();
348 } 345 }
349 346
350 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { 347 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() {
351 return io_data_.GetMainRequestContextGetter(); 348 return io_data_.GetMainRequestContextGetter();
352 } 349 }
353 350
354 quota::QuotaManager* OffTheRecordProfileImpl::GetQuotaManager() { 351 quota::QuotaManager* OffTheRecordProfileImpl::GetQuotaManager() {
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 660
664 #if defined(OS_CHROMEOS) 661 #if defined(OS_CHROMEOS)
665 // Special case of the OffTheRecordProfileImpl which is used while Guest 662 // Special case of the OffTheRecordProfileImpl which is used while Guest
666 // session in CrOS. 663 // session in CrOS.
667 class GuestSessionProfile : public OffTheRecordProfileImpl { 664 class GuestSessionProfile : public OffTheRecordProfileImpl {
668 public: 665 public:
669 explicit GuestSessionProfile(Profile* real_profile) 666 explicit GuestSessionProfile(Profile* real_profile)
670 : OffTheRecordProfileImpl(real_profile) { 667 : OffTheRecordProfileImpl(real_profile) {
671 } 668 }
672 669
673 virtual PersonalDataManager* GetPersonalDataManager() {
674 return GetOriginalProfile()->GetPersonalDataManager();
675 }
676
677 virtual void InitChromeOSPreferences() { 670 virtual void InitChromeOSPreferences() {
678 chromeos_preferences_.reset(new chromeos::Preferences()); 671 chromeos_preferences_.reset(new chromeos::Preferences());
679 chromeos_preferences_->Init(GetPrefs()); 672 chromeos_preferences_->Init(GetPrefs());
680 } 673 }
681 674
682 private: 675 private:
683 // The guest user should be able to customize Chrome OS preferences. 676 // The guest user should be able to customize Chrome OS preferences.
684 scoped_ptr<chromeos::Preferences> chromeos_preferences_; 677 scoped_ptr<chromeos::Preferences> chromeos_preferences_;
685 }; 678 };
686 #endif 679 #endif
687 680
688 Profile* Profile::CreateOffTheRecordProfile() { 681 Profile* Profile::CreateOffTheRecordProfile() {
689 OffTheRecordProfileImpl* profile = NULL; 682 OffTheRecordProfileImpl* profile = NULL;
690 #if defined(OS_CHROMEOS) 683 #if defined(OS_CHROMEOS)
691 if (Profile::IsGuestSession()) 684 if (Profile::IsGuestSession())
692 profile = new GuestSessionProfile(this); 685 profile = new GuestSessionProfile(this);
693 #endif 686 #endif
694 if (!profile) 687 if (!profile)
695 profile = new OffTheRecordProfileImpl(this); 688 profile = new OffTheRecordProfileImpl(this);
696 profile->Init(); 689 profile->Init();
697 return profile; 690 return profile;
698 } 691 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698