| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "chrome/browser/metrics/thread_watcher.h" | 38 #include "chrome/browser/metrics/thread_watcher.h" |
| 39 #include "chrome/browser/net/chrome_net_log.h" | 39 #include "chrome/browser/net/chrome_net_log.h" |
| 40 #include "chrome/browser/net/predictor_api.h" | 40 #include "chrome/browser/net/predictor_api.h" |
| 41 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 41 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 42 #include "chrome/browser/notifications/notification_ui_manager.h" | 42 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 43 #include "chrome/browser/platform_util.h" | 43 #include "chrome/browser/platform_util.h" |
| 44 #include "chrome/browser/plugin_data_remover.h" | 44 #include "chrome/browser/plugin_data_remover.h" |
| 45 #include "chrome/browser/policy/browser_policy_connector.h" | 45 #include "chrome/browser/policy/browser_policy_connector.h" |
| 46 #include "chrome/browser/prefs/browser_prefs.h" | 46 #include "chrome/browser/prefs/browser_prefs.h" |
| 47 #include "chrome/browser/prefs/pref_service.h" | 47 #include "chrome/browser/prefs/pref_service.h" |
| 48 #include "chrome/browser/prerender/prerender_tracker.h" |
| 48 #include "chrome/browser/printing/background_printing_manager.h" | 49 #include "chrome/browser/printing/background_printing_manager.h" |
| 49 #include "chrome/browser/printing/print_job_manager.h" | 50 #include "chrome/browser/printing/print_job_manager.h" |
| 50 #include "chrome/browser/printing/print_preview_tab_controller.h" | 51 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 51 #include "chrome/browser/profiles/profile_manager.h" | 52 #include "chrome/browser/profiles/profile_manager.h" |
| 52 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 53 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 53 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 54 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 54 #include "chrome/browser/shell_integration.h" | 55 #include "chrome/browser/shell_integration.h" |
| 55 #include "chrome/browser/sidebar/sidebar_manager.h" | 56 #include "chrome/browser/sidebar/sidebar_manager.h" |
| 56 #include "chrome/browser/tab_closeable_state_watcher.h" | 57 #include "chrome/browser/tab_closeable_state_watcher.h" |
| 57 #include "chrome/browser/ui/browser_list.h" | 58 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), | 688 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), |
| 688 this, | 689 this, |
| 689 &BrowserProcessImpl::OnAutoupdateTimer); | 690 &BrowserProcessImpl::OnAutoupdateTimer); |
| 690 } | 691 } |
| 691 #endif | 692 #endif |
| 692 | 693 |
| 693 ChromeNetLog* BrowserProcessImpl::net_log() { | 694 ChromeNetLog* BrowserProcessImpl::net_log() { |
| 694 return net_log_.get(); | 695 return net_log_.get(); |
| 695 } | 696 } |
| 696 | 697 |
| 698 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() { |
| 699 return prerender_tracker_.get(); |
| 700 } |
| 701 |
| 697 void BrowserProcessImpl::ClearLocalState(const FilePath& profile_path) { | 702 void BrowserProcessImpl::ClearLocalState(const FilePath& profile_path) { |
| 698 webkit_database::DatabaseTracker::ClearLocalState(profile_path); | 703 webkit_database::DatabaseTracker::ClearLocalState(profile_path); |
| 699 BrowsingDataRemover::ClearGearsData(profile_path); | 704 BrowsingDataRemover::ClearGearsData(profile_path); |
| 700 } | 705 } |
| 701 | 706 |
| 702 bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { | 707 bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { |
| 703 FilePath user_data_dir; | 708 FilePath user_data_dir; |
| 704 Profile* profile; | 709 Profile* profile; |
| 705 | 710 |
| 706 // Check for the existence of a profile manager. When quitting early, | 711 // Check for the existence of a profile manager. When quitting early, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 723 resource_dispatcher_host_.get() == NULL); | 728 resource_dispatcher_host_.get() == NULL); |
| 724 created_resource_dispatcher_host_ = true; | 729 created_resource_dispatcher_host_ = true; |
| 725 | 730 |
| 726 // UserScriptListener will delete itself. | 731 // UserScriptListener will delete itself. |
| 727 ResourceQueue::DelegateSet resource_queue_delegates; | 732 ResourceQueue::DelegateSet resource_queue_delegates; |
| 728 resource_queue_delegates.insert(new UserScriptListener()); | 733 resource_queue_delegates.insert(new UserScriptListener()); |
| 729 | 734 |
| 730 resource_dispatcher_host_.reset( | 735 resource_dispatcher_host_.reset( |
| 731 new ResourceDispatcherHost(resource_queue_delegates)); | 736 new ResourceDispatcherHost(resource_queue_delegates)); |
| 732 resource_dispatcher_host_->Initialize(); | 737 resource_dispatcher_host_->Initialize(); |
| 738 |
| 739 prerender_tracker_.reset(new prerender::PrerenderTracker); |
| 740 resource_dispatcher_host_->set_observer(prerender_tracker_.get()); |
| 733 } | 741 } |
| 734 | 742 |
| 735 void BrowserProcessImpl::CreateMetricsService() { | 743 void BrowserProcessImpl::CreateMetricsService() { |
| 736 DCHECK(!created_metrics_service_ && metrics_service_.get() == NULL); | 744 DCHECK(!created_metrics_service_ && metrics_service_.get() == NULL); |
| 737 created_metrics_service_ = true; | 745 created_metrics_service_ = true; |
| 738 | 746 |
| 739 metrics_service_.reset(new MetricsService); | 747 metrics_service_.reset(new MetricsService); |
| 740 } | 748 } |
| 741 | 749 |
| 742 void BrowserProcessImpl::CreateIOThread() { | 750 void BrowserProcessImpl::CreateIOThread() { |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 } | 1129 } |
| 1122 | 1130 |
| 1123 void BrowserProcessImpl::OnAutoupdateTimer() { | 1131 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1124 if (CanAutorestartForUpdate()) { | 1132 if (CanAutorestartForUpdate()) { |
| 1125 DLOG(WARNING) << "Detected update. Restarting browser."; | 1133 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1126 RestartPersistentInstance(); | 1134 RestartPersistentInstance(); |
| 1127 } | 1135 } |
| 1128 } | 1136 } |
| 1129 | 1137 |
| 1130 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1138 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |