OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "app/theme_provider.h" | 8 #include "app/theme_provider.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/env_var.h" | 10 #include "base/env_var.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 339 |
340 virtual Profile* GetOffTheRecordProfile() { | 340 virtual Profile* GetOffTheRecordProfile() { |
341 return this; | 341 return this; |
342 } | 342 } |
343 | 343 |
344 virtual void DestroyOffTheRecordProfile() { | 344 virtual void DestroyOffTheRecordProfile() { |
345 // Suicide is bad! | 345 // Suicide is bad! |
346 NOTREACHED(); | 346 NOTREACHED(); |
347 } | 347 } |
348 | 348 |
| 349 virtual bool HasOffTheRecordProfile() { |
| 350 return true; |
| 351 } |
| 352 |
349 virtual Profile* GetOriginalProfile() { | 353 virtual Profile* GetOriginalProfile() { |
350 return profile_; | 354 return profile_; |
351 } | 355 } |
352 | 356 |
353 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() { | 357 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() { |
354 if (!db_tracker_) { | 358 if (!db_tracker_) { |
355 db_tracker_ = new webkit_database::DatabaseTracker( | 359 db_tracker_ = new webkit_database::DatabaseTracker( |
356 GetPath(), IsOffTheRecord()); | 360 GetPath(), IsOffTheRecord()); |
357 } | 361 } |
358 return db_tracker_; | 362 return db_tracker_; |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 scoped_ptr<OffTheRecordProfileImpl> p(new OffTheRecordProfileImpl(this)); | 1021 scoped_ptr<OffTheRecordProfileImpl> p(new OffTheRecordProfileImpl(this)); |
1018 off_the_record_profile_.swap(p); | 1022 off_the_record_profile_.swap(p); |
1019 } | 1023 } |
1020 return off_the_record_profile_.get(); | 1024 return off_the_record_profile_.get(); |
1021 } | 1025 } |
1022 | 1026 |
1023 void ProfileImpl::DestroyOffTheRecordProfile() { | 1027 void ProfileImpl::DestroyOffTheRecordProfile() { |
1024 off_the_record_profile_.reset(); | 1028 off_the_record_profile_.reset(); |
1025 } | 1029 } |
1026 | 1030 |
| 1031 bool ProfileImpl::HasOffTheRecordProfile() { |
| 1032 return off_the_record_profile_.get() != NULL; |
| 1033 } |
| 1034 |
1027 Profile* ProfileImpl::GetOriginalProfile() { | 1035 Profile* ProfileImpl::GetOriginalProfile() { |
1028 return this; | 1036 return this; |
1029 } | 1037 } |
1030 | 1038 |
1031 webkit_database::DatabaseTracker* ProfileImpl::GetDatabaseTracker() { | 1039 webkit_database::DatabaseTracker* ProfileImpl::GetDatabaseTracker() { |
1032 if (!db_tracker_) { | 1040 if (!db_tracker_) { |
1033 db_tracker_ = new webkit_database::DatabaseTracker( | 1041 db_tracker_ = new webkit_database::DatabaseTracker( |
1034 GetPath(), IsOffTheRecord()); | 1042 GetPath(), IsOffTheRecord()); |
1035 } | 1043 } |
1036 return db_tracker_; | 1044 return db_tracker_; |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); | 1683 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); |
1676 sync_service_.reset( | 1684 sync_service_.reset( |
1677 profile_sync_factory_->CreateProfileSyncService()); | 1685 profile_sync_factory_->CreateProfileSyncService()); |
1678 sync_service_->Initialize(); | 1686 sync_service_->Initialize(); |
1679 } | 1687 } |
1680 | 1688 |
1681 void ProfileImpl::InitCloudPrintProxyService() { | 1689 void ProfileImpl::InitCloudPrintProxyService() { |
1682 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); | 1690 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); |
1683 cloud_print_proxy_service_->Initialize(); | 1691 cloud_print_proxy_service_->Initialize(); |
1684 } | 1692 } |
OLD | NEW |