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

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

Issue 6484033: Fix a bug that caused Chrome OS system preferences not to work in the guest mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rework again! Created 9 years, 10 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
« no previous file with comments | « chrome/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 #if defined(OS_WIN) 51 #if defined(OS_WIN)
52 #include "chrome/browser/password_manager/password_store_win.h" 52 #include "chrome/browser/password_manager/password_store_win.h"
53 #elif defined(OS_MACOSX) 53 #elif defined(OS_MACOSX)
54 #include "chrome/browser/keychain_mac.h" 54 #include "chrome/browser/keychain_mac.h"
55 #include "chrome/browser/password_manager/password_store_mac.h" 55 #include "chrome/browser/password_manager/password_store_mac.h"
56 #elif defined(OS_POSIX) && !defined(OS_CHROMEOS) 56 #elif defined(OS_POSIX) && !defined(OS_CHROMEOS)
57 #include "chrome/browser/password_manager/native_backend_gnome_x.h" 57 #include "chrome/browser/password_manager/native_backend_gnome_x.h"
58 #include "chrome/browser/password_manager/native_backend_kwallet_x.h" 58 #include "chrome/browser/password_manager/native_backend_kwallet_x.h"
59 #include "chrome/browser/password_manager/password_store_x.h" 59 #include "chrome/browser/password_manager/password_store_x.h"
60 #elif defined(OS_CHROMEOS)
61 #include "chrome/browser/chromeos/preferences.h"
60 #endif 62 #endif
61 63
62 using base::Time; 64 using base::Time;
63 using base::TimeDelta; 65 using base::TimeDelta;
64 66
65 // A pointer to the request context for the default profile. See comments on 67 // A pointer to the request context for the default profile. See comments on
66 // Profile::GetDefaultRequestContext. 68 // Profile::GetDefaultRequestContext.
67 URLRequestContextGetter* Profile::default_request_context_; 69 URLRequestContextGetter* Profile::default_request_context_;
68 70
69 namespace { 71 namespace {
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 586
585 #if defined(OS_CHROMEOS) 587 #if defined(OS_CHROMEOS)
586 virtual chromeos::ProxyConfigServiceImpl* 588 virtual chromeos::ProxyConfigServiceImpl*
587 GetChromeOSProxyConfigServiceImpl() { 589 GetChromeOSProxyConfigServiceImpl() {
588 return profile_->GetChromeOSProxyConfigServiceImpl(); 590 return profile_->GetChromeOSProxyConfigServiceImpl();
589 } 591 }
590 592
591 virtual void SetupChromeOSEnterpriseExtensionObserver() { 593 virtual void SetupChromeOSEnterpriseExtensionObserver() {
592 profile_->SetupChromeOSEnterpriseExtensionObserver(); 594 profile_->SetupChromeOSEnterpriseExtensionObserver();
593 } 595 }
596
597 virtual void InitChromeOSPreferences() {
598 // The off-the-record profile shouldn't have Chrome OS's preferences.
599 // The preferences are associated with the regular user profile.
600 }
594 #endif // defined(OS_CHROMEOS) 601 #endif // defined(OS_CHROMEOS)
595 602
596 virtual void ExitedOffTheRecordMode() { 603 virtual void ExitedOffTheRecordMode() {
597 // DownloadManager is lazily created, so check before accessing it. 604 // DownloadManager is lazily created, so check before accessing it.
598 if (download_manager_.get()) { 605 if (download_manager_.get()) {
599 // Drop our download manager so we forget about all the downloads made 606 // Drop our download manager so we forget about all the downloads made
600 // in off-the-record mode. 607 // in off-the-record mode.
601 download_manager_->Shutdown(); 608 download_manager_->Shutdown();
602 download_manager_ = NULL; 609 download_manager_ = NULL;
603 } 610 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 // session in CrOS. 743 // session in CrOS.
737 class GuestSessionProfile : public OffTheRecordProfileImpl { 744 class GuestSessionProfile : public OffTheRecordProfileImpl {
738 public: 745 public:
739 explicit GuestSessionProfile(Profile* real_profile) 746 explicit GuestSessionProfile(Profile* real_profile)
740 : OffTheRecordProfileImpl(real_profile) { 747 : OffTheRecordProfileImpl(real_profile) {
741 } 748 }
742 749
743 virtual PersonalDataManager* GetPersonalDataManager() { 750 virtual PersonalDataManager* GetPersonalDataManager() {
744 return GetOriginalProfile()->GetPersonalDataManager(); 751 return GetOriginalProfile()->GetPersonalDataManager();
745 } 752 }
753
754 virtual void InitChromeOSPreferences() {
755 chromeos_preferences_.reset(new chromeos::Preferences());
756 chromeos_preferences_->Init(GetPrefs());
757 }
758
759 private:
760 // The guest user should be able to customize Chrome OS preferences.
761 scoped_ptr<chromeos::Preferences> chromeos_preferences_;
746 }; 762 };
747 #endif 763 #endif
748 764
749 Profile* Profile::CreateOffTheRecordProfile() { 765 Profile* Profile::CreateOffTheRecordProfile() {
750 #if defined(OS_CHROMEOS) 766 #if defined(OS_CHROMEOS)
751 if (Profile::IsGuestSession()) 767 if (Profile::IsGuestSession())
752 return new GuestSessionProfile(this); 768 return new GuestSessionProfile(this);
753 #endif 769 #endif
754 return new OffTheRecordProfileImpl(this); 770 return new OffTheRecordProfileImpl(this);
755 } 771 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698