| 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 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 36 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
| 37 #include "chrome/browser/geolocation/geolocation_permission_context.h" | 37 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| 38 #include "chrome/browser/spellcheck_host.h" | 38 #include "chrome/browser/spellcheck_host.h" |
| 39 #include "chrome/browser/transport_security_persister.h" | 39 #include "chrome/browser/transport_security_persister.h" |
| 40 #include "chrome/browser/history/history.h" | 40 #include "chrome/browser/history/history.h" |
| 41 #include "chrome/browser/history/top_sites.h" | 41 #include "chrome/browser/history/top_sites.h" |
| 42 #include "chrome/browser/host_content_settings_map.h" | 42 #include "chrome/browser/host_content_settings_map.h" |
| 43 #include "chrome/browser/host_zoom_map.h" | 43 #include "chrome/browser/host_zoom_map.h" |
| 44 #include "chrome/browser/in_process_webkit/webkit_context.h" | 44 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| 45 #include "chrome/browser/net/chrome_url_request_context.h" | 45 #include "chrome/browser/net/chrome_url_request_context.h" |
| 46 #include "chrome/browser/net/gaia/token_service.h" |
| 46 #include "chrome/browser/net/ssl_config_service_manager.h" | 47 #include "chrome/browser/net/ssl_config_service_manager.h" |
| 47 #include "chrome/browser/notifications/desktop_notification_service.h" | 48 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 48 #include "chrome/browser/password_manager/password_store_default.h" | 49 #include "chrome/browser/password_manager/password_store_default.h" |
| 49 #include "chrome/browser/pref_value_store.h" | 50 #include "chrome/browser/pref_value_store.h" |
| 50 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 51 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 51 #include "chrome/browser/profile_manager.h" | 52 #include "chrome/browser/profile_manager.h" |
| 52 #include "chrome/browser/renderer_host/render_process_host.h" | 53 #include "chrome/browser/renderer_host/render_process_host.h" |
| 53 #include "chrome/browser/search_engines/template_url_fetcher.h" | 54 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 54 #include "chrome/browser/search_engines/template_url_model.h" | 55 #include "chrome/browser/search_engines/template_url_model.h" |
| 55 #include "chrome/browser/sessions/session_service.h" | 56 #include "chrome/browser/sessions/session_service.h" |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 } | 578 } |
| 578 | 579 |
| 579 virtual DesktopNotificationService* GetDesktopNotificationService() { | 580 virtual DesktopNotificationService* GetDesktopNotificationService() { |
| 580 if (!desktop_notification_service_.get()) { | 581 if (!desktop_notification_service_.get()) { |
| 581 desktop_notification_service_.reset(new DesktopNotificationService( | 582 desktop_notification_service_.reset(new DesktopNotificationService( |
| 582 this, g_browser_process->notification_ui_manager())); | 583 this, g_browser_process->notification_ui_manager())); |
| 583 } | 584 } |
| 584 return desktop_notification_service_.get(); | 585 return desktop_notification_service_.get(); |
| 585 } | 586 } |
| 586 | 587 |
| 588 virtual TokenService* GetTokenService() { |
| 589 return NULL; |
| 590 } |
| 591 |
| 587 virtual ProfileSyncService* GetProfileSyncService() { | 592 virtual ProfileSyncService* GetProfileSyncService() { |
| 588 return NULL; | 593 return NULL; |
| 589 } | 594 } |
| 590 | 595 |
| 591 virtual CloudPrintProxyService* GetCloudPrintProxyService() { | 596 virtual CloudPrintProxyService* GetCloudPrintProxyService() { |
| 592 return NULL; | 597 return NULL; |
| 593 } | 598 } |
| 594 | 599 |
| 595 virtual bool IsSameProfile(Profile* profile) { | 600 virtual bool IsSameProfile(Profile* profile) { |
| 596 return (profile == this) || (profile == profile_); | 601 return (profile == this) || (profile == profile_); |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1622 GetProfileSyncService(); // Causes lazy-load if sync is enabled. | 1627 GetProfileSyncService(); // Causes lazy-load if sync is enabled. |
| 1623 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED, | 1628 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED, |
| 1624 Source<Profile>(this)); | 1629 Source<Profile>(this)); |
| 1625 } | 1630 } |
| 1626 } | 1631 } |
| 1627 | 1632 |
| 1628 void ProfileImpl::StopCreateSessionServiceTimer() { | 1633 void ProfileImpl::StopCreateSessionServiceTimer() { |
| 1629 create_session_service_timer_.Stop(); | 1634 create_session_service_timer_.Stop(); |
| 1630 } | 1635 } |
| 1631 | 1636 |
| 1637 TokenService* ProfileImpl::GetTokenService() { |
| 1638 if (!token_service_.get()) { |
| 1639 token_service_.reset(new TokenService()); |
| 1640 } |
| 1641 return token_service_.get(); |
| 1642 } |
| 1643 |
| 1632 ProfileSyncService* ProfileImpl::GetProfileSyncService() { | 1644 ProfileSyncService* ProfileImpl::GetProfileSyncService() { |
| 1633 if (!ProfileSyncService::IsSyncEnabled()) { | 1645 if (!ProfileSyncService::IsSyncEnabled()) { |
| 1634 return NULL; | 1646 return NULL; |
| 1635 } | 1647 } |
| 1636 if (!sync_service_.get()) | 1648 if (!sync_service_.get()) |
| 1637 InitSyncService(); | 1649 InitSyncService(); |
| 1638 return sync_service_.get(); | 1650 return sync_service_.get(); |
| 1639 } | 1651 } |
| 1640 | 1652 |
| 1641 CloudPrintProxyService* ProfileImpl::GetCloudPrintProxyService() { | 1653 CloudPrintProxyService* ProfileImpl::GetCloudPrintProxyService() { |
| 1642 if (!cloud_print_proxy_service_.get()) | 1654 if (!cloud_print_proxy_service_.get()) |
| 1643 InitCloudPrintProxyService(); | 1655 InitCloudPrintProxyService(); |
| 1644 return cloud_print_proxy_service_.get(); | 1656 return cloud_print_proxy_service_.get(); |
| 1645 } | 1657 } |
| 1646 | 1658 |
| 1647 void ProfileImpl::InitSyncService() { | 1659 void ProfileImpl::InitSyncService() { |
| 1648 profile_sync_factory_.reset( | 1660 profile_sync_factory_.reset( |
| 1649 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); | 1661 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); |
| 1650 sync_service_.reset( | 1662 sync_service_.reset( |
| 1651 profile_sync_factory_->CreateProfileSyncService()); | 1663 profile_sync_factory_->CreateProfileSyncService()); |
| 1652 sync_service_->Initialize(); | 1664 sync_service_->Initialize(); |
| 1653 } | 1665 } |
| 1654 | 1666 |
| 1655 void ProfileImpl::InitCloudPrintProxyService() { | 1667 void ProfileImpl::InitCloudPrintProxyService() { |
| 1656 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); | 1668 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); |
| 1657 cloud_print_proxy_service_->Initialize(); | 1669 cloud_print_proxy_service_->Initialize(); |
| 1658 } | 1670 } |
| OLD | NEW |