OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/profile.h" | 5 #include "chrome/browser/profile.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // | 92 // |
93 // OffTheRecordProfileImpl is a profile subclass that wraps an existing profile | 93 // OffTheRecordProfileImpl is a profile subclass that wraps an existing profile |
94 // to make it suitable for the off the record mode. | 94 // to make it suitable for the off the record mode. |
95 // | 95 // |
96 //////////////////////////////////////////////////////////////////////////////// | 96 //////////////////////////////////////////////////////////////////////////////// |
97 class OffTheRecordProfileImpl : public Profile, | 97 class OffTheRecordProfileImpl : public Profile, |
98 public NotificationObserver { | 98 public NotificationObserver { |
99 public: | 99 public: |
100 explicit OffTheRecordProfileImpl(Profile* real_profile) | 100 explicit OffTheRecordProfileImpl(Profile* real_profile) |
101 : profile_(real_profile), | 101 : profile_(real_profile), |
| 102 media_request_context_(NULL), |
102 start_time_(Time::Now()) { | 103 start_time_(Time::Now()) { |
103 request_context_ = ChromeURLRequestContext::CreateOffTheRecord(this); | 104 request_context_ = ChromeURLRequestContext::CreateOffTheRecord(this); |
104 request_context_->AddRef(); | 105 request_context_->AddRef(); |
105 // Register for browser close notifications so we can detect when the last | 106 // Register for browser close notifications so we can detect when the last |
106 // off-the-record window is closed, in which case we can clean our states | 107 // off-the-record window is closed, in which case we can clean our states |
107 // (cookies, downloads...). | 108 // (cookies, downloads...). |
108 NotificationService::current()->AddObserver( | 109 NotificationService::current()->AddObserver( |
109 this, | 110 this, |
110 NotificationType::BROWSER_CLOSED, | 111 NotificationType::BROWSER_CLOSED, |
111 NotificationService::AllSources()); | 112 NotificationService::AllSources()); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 DISALLOW_EVIL_CONSTRUCTORS(OffTheRecordProfileImpl); | 344 DISALLOW_EVIL_CONSTRUCTORS(OffTheRecordProfileImpl); |
344 }; | 345 }; |
345 | 346 |
346 ProfileImpl::ProfileImpl(const FilePath& path) | 347 ProfileImpl::ProfileImpl(const FilePath& path) |
347 : path_(path), | 348 : path_(path), |
348 off_the_record_(false), | 349 off_the_record_(false), |
349 #ifdef CHROME_PERSONALIZATION | 350 #ifdef CHROME_PERSONALIZATION |
350 personalization_(NULL), | 351 personalization_(NULL), |
351 #endif | 352 #endif |
352 request_context_(NULL), | 353 request_context_(NULL), |
| 354 media_request_context_(NULL), |
353 history_service_created_(false), | 355 history_service_created_(false), |
354 created_web_data_service_(false), | 356 created_web_data_service_(false), |
355 created_download_manager_(false), | 357 created_download_manager_(false), |
356 start_time_(Time::Now()), | 358 start_time_(Time::Now()), |
357 spellchecker_(NULL), | 359 spellchecker_(NULL), |
358 shutdown_session_service_(false) { | 360 shutdown_session_service_(false) { |
359 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << | 361 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << |
360 "profile files to the root directory!"; | 362 "profile files to the root directory!"; |
361 create_session_service_timer_.Start( | 363 create_session_service_timer_.Start( |
362 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, | 364 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 | 872 |
871 #ifdef CHROME_PERSONALIZATION | 873 #ifdef CHROME_PERSONALIZATION |
872 ProfilePersonalization* ProfileImpl::GetProfilePersonalization() { | 874 ProfilePersonalization* ProfileImpl::GetProfilePersonalization() { |
873 DCHECK(!Personalization::IsP13NDisabled()); | 875 DCHECK(!Personalization::IsP13NDisabled()); |
874 if (!personalization_.get()) | 876 if (!personalization_.get()) |
875 personalization_.reset( | 877 personalization_.reset( |
876 Personalization::CreateProfilePersonalization(this)); | 878 Personalization::CreateProfilePersonalization(this)); |
877 return personalization_.get(); | 879 return personalization_.get(); |
878 } | 880 } |
879 #endif | 881 #endif |
OLD | NEW |