| 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 "app/theme_provider.h" | 7 #include "app/theme_provider.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/strict_transport_security_persister.h" | 25 #include "chrome/browser/strict_transport_security_persister.h" |
| 26 #include "chrome/browser/history/history.h" | 26 #include "chrome/browser/history/history.h" |
| 27 #include "chrome/browser/in_process_webkit/webkit_context.h" | 27 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| 28 #include "chrome/browser/net/chrome_url_request_context.h" | 28 #include "chrome/browser/net/chrome_url_request_context.h" |
| 29 #include "chrome/browser/net/ssl_config_service_manager.h" | 29 #include "chrome/browser/net/ssl_config_service_manager.h" |
| 30 #include "chrome/browser/notifications/desktop_notification_service.h" | 30 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 31 #include "chrome/browser/password_manager/password_store_default.h" | 31 #include "chrome/browser/password_manager/password_store_default.h" |
| 32 #include "chrome/browser/privacy_blacklist/blacklist.h" | 32 #include "chrome/browser/privacy_blacklist/blacklist.h" |
| 33 #include "chrome/browser/profile_manager.h" | 33 #include "chrome/browser/profile_manager.h" |
| 34 #include "chrome/browser/renderer_host/render_process_host.h" | 34 #include "chrome/browser/renderer_host/render_process_host.h" |
| 35 #include "chrome/browser/search_versus_navigate_classifier.h" |
| 35 #include "chrome/browser/search_engines/template_url_fetcher.h" | 36 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 36 #include "chrome/browser/search_engines/template_url_model.h" | 37 #include "chrome/browser/search_engines/template_url_model.h" |
| 37 #include "chrome/browser/sessions/session_service.h" | 38 #include "chrome/browser/sessions/session_service.h" |
| 38 #include "chrome/browser/sessions/tab_restore_service.h" | 39 #include "chrome/browser/sessions/tab_restore_service.h" |
| 39 #include "chrome/browser/spellchecker.h" | 40 #include "chrome/browser/spellchecker.h" |
| 40 #include "chrome/browser/ssl/ssl_host_state.h" | 41 #include "chrome/browser/ssl/ssl_host_state.h" |
| 41 #include "chrome/browser/sync/profile_sync_service.h" | 42 #include "chrome/browser/sync/profile_sync_service.h" |
| 42 #include "chrome/browser/thumbnail_store.h" | 43 #include "chrome/browser/thumbnail_store.h" |
| 43 #include "chrome/browser/visitedlink_master.h" | 44 #include "chrome/browser/visitedlink_master.h" |
| 44 #include "chrome/browser/visitedlink_event_listener.h" | 45 #include "chrome/browser/visitedlink_event_listener.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 295 |
| 295 virtual FaviconService* GetFaviconService(ServiceAccessType sat) { | 296 virtual FaviconService* GetFaviconService(ServiceAccessType sat) { |
| 296 if (sat == EXPLICIT_ACCESS) { | 297 if (sat == EXPLICIT_ACCESS) { |
| 297 return profile_->GetFaviconService(sat); | 298 return profile_->GetFaviconService(sat); |
| 298 } else { | 299 } else { |
| 299 NOTREACHED() << "This profile is OffTheRecord"; | 300 NOTREACHED() << "This profile is OffTheRecord"; |
| 300 return NULL; | 301 return NULL; |
| 301 } | 302 } |
| 302 } | 303 } |
| 303 | 304 |
| 305 virtual SearchVersusNavigateClassifier* GetSearchVersusNavigateClassifier() { |
| 306 return profile_->GetSearchVersusNavigateClassifier(); |
| 307 } |
| 308 |
| 304 virtual WebDataService* GetWebDataService(ServiceAccessType sat) { | 309 virtual WebDataService* GetWebDataService(ServiceAccessType sat) { |
| 305 if (sat == EXPLICIT_ACCESS) { | 310 if (sat == EXPLICIT_ACCESS) { |
| 306 return profile_->GetWebDataService(sat); | 311 return profile_->GetWebDataService(sat); |
| 307 } else { | 312 } else { |
| 308 NOTREACHED() << "This profile is OffTheRecord"; | 313 NOTREACHED() << "This profile is OffTheRecord"; |
| 309 return NULL; | 314 return NULL; |
| 310 } | 315 } |
| 311 } | 316 } |
| 312 | 317 |
| 313 virtual WebDataService* GetWebDataServiceWithoutCreating() { | 318 virtual WebDataService* GetWebDataServiceWithoutCreating() { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 // the user visited while OTR. | 544 // the user visited while OTR. |
| 540 scoped_ptr<SSLHostState> ssl_host_state_; | 545 scoped_ptr<SSLHostState> ssl_host_state_; |
| 541 | 546 |
| 542 // The StrictTransportSecurityState that only stores enabled sites in memory. | 547 // The StrictTransportSecurityState that only stores enabled sites in memory. |
| 543 scoped_refptr<net::StrictTransportSecurityState> | 548 scoped_refptr<net::StrictTransportSecurityState> |
| 544 strict_transport_security_state_; | 549 strict_transport_security_state_; |
| 545 | 550 |
| 546 // Time we were started. | 551 // Time we were started. |
| 547 Time start_time_; | 552 Time start_time_; |
| 548 | 553 |
| 549 DISALLOW_EVIL_CONSTRUCTORS(OffTheRecordProfileImpl); | 554 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); |
| 550 }; | 555 }; |
| 551 | 556 |
| 552 ProfileImpl::ProfileImpl(const FilePath& path) | 557 ProfileImpl::ProfileImpl(const FilePath& path) |
| 553 : path_(path), | 558 : path_(path), |
| 554 visited_link_event_listener_(new VisitedLinkEventListener()), | 559 visited_link_event_listener_(new VisitedLinkEventListener()), |
| 555 extension_devtools_manager_(NULL), | 560 extension_devtools_manager_(NULL), |
| 556 request_context_(NULL), | 561 request_context_(NULL), |
| 557 media_request_context_(NULL), | 562 media_request_context_(NULL), |
| 558 extensions_request_context_(NULL), | 563 extensions_request_context_(NULL), |
| 559 blacklist_(NULL), | 564 blacklist_(NULL), |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 template_url_model_.reset(new TemplateURLModel(this)); | 1003 template_url_model_.reset(new TemplateURLModel(this)); |
| 999 return template_url_model_.get(); | 1004 return template_url_model_.get(); |
| 1000 } | 1005 } |
| 1001 | 1006 |
| 1002 TemplateURLFetcher* ProfileImpl::GetTemplateURLFetcher() { | 1007 TemplateURLFetcher* ProfileImpl::GetTemplateURLFetcher() { |
| 1003 if (!template_url_fetcher_.get()) | 1008 if (!template_url_fetcher_.get()) |
| 1004 template_url_fetcher_.reset(new TemplateURLFetcher(this)); | 1009 template_url_fetcher_.reset(new TemplateURLFetcher(this)); |
| 1005 return template_url_fetcher_.get(); | 1010 return template_url_fetcher_.get(); |
| 1006 } | 1011 } |
| 1007 | 1012 |
| 1013 SearchVersusNavigateClassifier* ProfileImpl::GetSearchVersusNavigateClassifier() |
| 1014 { |
| 1015 if (!search_versus_navigate_classifier_.get()) { |
| 1016 search_versus_navigate_classifier_.reset( |
| 1017 new SearchVersusNavigateClassifier(this)); |
| 1018 } |
| 1019 return search_versus_navigate_classifier_.get(); |
| 1020 } |
| 1021 |
| 1008 WebDataService* ProfileImpl::GetWebDataService(ServiceAccessType sat) { | 1022 WebDataService* ProfileImpl::GetWebDataService(ServiceAccessType sat) { |
| 1009 if (!created_web_data_service_) | 1023 if (!created_web_data_service_) |
| 1010 CreateWebDataService(); | 1024 CreateWebDataService(); |
| 1011 return web_data_service_.get(); | 1025 return web_data_service_.get(); |
| 1012 } | 1026 } |
| 1013 | 1027 |
| 1014 WebDataService* ProfileImpl::GetWebDataServiceWithoutCreating() { | 1028 WebDataService* ProfileImpl::GetWebDataServiceWithoutCreating() { |
| 1015 return web_data_service_.get(); | 1029 return web_data_service_.get(); |
| 1016 } | 1030 } |
| 1017 | 1031 |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 return sync_service_.get(); | 1374 return sync_service_.get(); |
| 1361 } | 1375 } |
| 1362 #endif | 1376 #endif |
| 1363 return NULL; | 1377 return NULL; |
| 1364 } | 1378 } |
| 1365 | 1379 |
| 1366 void ProfileImpl::InitSyncService() { | 1380 void ProfileImpl::InitSyncService() { |
| 1367 sync_service_.reset(new ProfileSyncService(this)); | 1381 sync_service_.reset(new ProfileSyncService(this)); |
| 1368 sync_service_->Initialize(); | 1382 sync_service_->Initialize(); |
| 1369 } | 1383 } |
| OLD | NEW |