| Index: chrome/browser/profiles/profile.cc
|
| diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
|
| index ac869eb64697d21df4fab9bf2c0b313e6654ba09..85c71add6605df0949f327b104494cdb12d49a6b 100644
|
| --- a/chrome/browser/profiles/profile.cc
|
| +++ b/chrome/browser/profiles/profile.cc
|
| @@ -32,6 +32,7 @@
|
| #include "chrome/browser/ui/find_bar/find_bar_state.h"
|
| #include "chrome/common/chrome_constants.h"
|
| #include "chrome/common/chrome_paths.h"
|
| +#include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/json_pref_store.h"
|
| #include "chrome/common/notification_service.h"
|
| #include "chrome/common/pref_names.h"
|
| @@ -126,6 +127,16 @@ URLRequestContextGetter* Profile::GetDefaultRequestContext() {
|
| return default_request_context_;
|
| }
|
|
|
| +bool Profile::IsGuestSession() {
|
| +#if defined(OS_CHROMEOS)
|
| + static bool is_guest_session =
|
| + CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession);
|
| + return is_guest_session;
|
| +#else
|
| + return false;
|
| +#endif
|
| +}
|
| +
|
| bool Profile::IsSyncAccessible() {
|
| ProfileSyncService* syncService = GetProfileSyncService();
|
| return syncService && !syncService->IsManaged();
|
| @@ -711,6 +722,25 @@ class OffTheRecordProfileImpl : public Profile,
|
| DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl);
|
| };
|
|
|
| +#if defined(OS_CHROMEOS)
|
| +// Special case of the OffTheRecordProfileImpl which is used while Guest
|
| +// session in CrOS.
|
| +class GuestSessionProfile : public OffTheRecordProfileImpl {
|
| + public:
|
| + explicit GuestSessionProfile(Profile* real_profile)
|
| + : OffTheRecordProfileImpl(real_profile) {
|
| + }
|
| +
|
| + virtual PersonalDataManager* GetPersonalDataManager() {
|
| + return GetOriginalProfile()->GetPersonalDataManager();
|
| + }
|
| +};
|
| +#endif
|
| +
|
| Profile* Profile::CreateOffTheRecordProfile() {
|
| +#if defined(OS_CHROMEOS)
|
| + if (Profile::IsGuestSession())
|
| + return new GuestSessionProfile(this);
|
| +#endif
|
| return new OffTheRecordProfileImpl(this);
|
| }
|
|
|