| 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/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 virtual HostContentSettingsMap* GetHostContentSettingsMap() { | 433 virtual HostContentSettingsMap* GetHostContentSettingsMap() { |
| 434 // Retrieve the host content settings map of the parent profile in order to | 434 // Retrieve the host content settings map of the parent profile in order to |
| 435 // ensure the preferences have been migrated. | 435 // ensure the preferences have been migrated. |
| 436 profile_->GetHostContentSettingsMap(); | 436 profile_->GetHostContentSettingsMap(); |
| 437 if (!host_content_settings_map_.get()) | 437 if (!host_content_settings_map_.get()) |
| 438 host_content_settings_map_ = new HostContentSettingsMap(this); | 438 host_content_settings_map_ = new HostContentSettingsMap(this); |
| 439 return host_content_settings_map_.get(); | 439 return host_content_settings_map_.get(); |
| 440 } | 440 } |
| 441 | 441 |
| 442 virtual HostZoomMap* GetHostZoomMap() { | 442 virtual HostZoomMap* GetHostZoomMap() { |
| 443 return profile_->GetHostZoomMap(); | 443 if (!host_zoom_map_) |
| 444 host_zoom_map_ = new HostZoomMap(this); |
| 445 return host_zoom_map_.get(); |
| 444 } | 446 } |
| 445 | 447 |
| 446 virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() { | 448 virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() { |
| 447 return profile_->GetGeolocationContentSettingsMap(); | 449 return profile_->GetGeolocationContentSettingsMap(); |
| 448 } | 450 } |
| 449 | 451 |
| 450 virtual Blacklist* GetPrivacyBlacklist() { | 452 virtual Blacklist* GetPrivacyBlacklist() { |
| 451 return profile_->GetPrivacyBlacklist(); | 453 return profile_->GetPrivacyBlacklist(); |
| 452 } | 454 } |
| 453 | 455 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 579 |
| 578 // The download manager that only stores downloaded items in memory. | 580 // The download manager that only stores downloaded items in memory. |
| 579 scoped_refptr<DownloadManager> download_manager_; | 581 scoped_refptr<DownloadManager> download_manager_; |
| 580 | 582 |
| 581 // Use a separate desktop notification service for OTR. | 583 // Use a separate desktop notification service for OTR. |
| 582 scoped_ptr<DesktopNotificationService> desktop_notification_service_; | 584 scoped_ptr<DesktopNotificationService> desktop_notification_service_; |
| 583 | 585 |
| 584 // We use a non-writable content settings map for OTR. | 586 // We use a non-writable content settings map for OTR. |
| 585 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 587 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 586 | 588 |
| 589 // Use a separate zoom map for OTR. |
| 590 scoped_refptr<HostZoomMap> host_zoom_map_; |
| 591 |
| 587 // Use a special WebKit context for OTR browsing. | 592 // Use a special WebKit context for OTR browsing. |
| 588 scoped_refptr<WebKitContext> webkit_context_; | 593 scoped_refptr<WebKitContext> webkit_context_; |
| 589 | 594 |
| 590 // We don't want SSLHostState from the OTR profile to leak back to the main | 595 // We don't want SSLHostState from the OTR profile to leak back to the main |
| 591 // profile because then the main profile would learn some of the host names | 596 // profile because then the main profile would learn some of the host names |
| 592 // the user visited while OTR. | 597 // the user visited while OTR. |
| 593 scoped_ptr<SSLHostState> ssl_host_state_; | 598 scoped_ptr<SSLHostState> ssl_host_state_; |
| 594 | 599 |
| 595 // Use a separate FindBarState so search terms do not leak back to the main | 600 // Use a separate FindBarState so search terms do not leak back to the main |
| 596 // profile. | 601 // profile. |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 } | 1449 } |
| 1445 | 1450 |
| 1446 void ProfileImpl::InitSyncService() { | 1451 void ProfileImpl::InitSyncService() { |
| 1447 profile_sync_factory_.reset( | 1452 profile_sync_factory_.reset( |
| 1448 new ProfileSyncFactoryImpl(this, | 1453 new ProfileSyncFactoryImpl(this, |
| 1449 CommandLine::ForCurrentProcess())); | 1454 CommandLine::ForCurrentProcess())); |
| 1450 sync_service_.reset( | 1455 sync_service_.reset( |
| 1451 profile_sync_factory_->CreateProfileSyncService()); | 1456 profile_sync_factory_->CreateProfileSyncService()); |
| 1452 sync_service_->Initialize(); | 1457 sync_service_->Initialize(); |
| 1453 } | 1458 } |
| OLD | NEW |