| 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> |
| 9 #include <vector> |
| 8 | 10 |
| 9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 11 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 12 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" |
| 13 #include "base/task.h" | 15 #include "base/task.h" |
| 14 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 15 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
| 16 #include "chrome/browser/automation/automation_provider_list.h" | 18 #include "chrome/browser/automation/automation_provider_list.h" |
| 17 #include "chrome/browser/browser_main.h" | 19 #include "chrome/browser/browser_main.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 34 #include "chrome/browser/metrics/metrics_service.h" | 36 #include "chrome/browser/metrics/metrics_service.h" |
| 35 #include "chrome/browser/metrics/thread_watcher.h" | 37 #include "chrome/browser/metrics/thread_watcher.h" |
| 36 #include "chrome/browser/net/chrome_net_log.h" | 38 #include "chrome/browser/net/chrome_net_log.h" |
| 37 #include "chrome/browser/net/predictor_api.h" | 39 #include "chrome/browser/net/predictor_api.h" |
| 38 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 40 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 39 #include "chrome/browser/notifications/notification_ui_manager.h" | 41 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 40 #include "chrome/browser/plugin_data_remover.h" | 42 #include "chrome/browser/plugin_data_remover.h" |
| 41 #include "chrome/browser/policy/browser_policy_connector.h" | 43 #include "chrome/browser/policy/browser_policy_connector.h" |
| 42 #include "chrome/browser/prefs/browser_prefs.h" | 44 #include "chrome/browser/prefs/browser_prefs.h" |
| 43 #include "chrome/browser/prefs/pref_service.h" | 45 #include "chrome/browser/prefs/pref_service.h" |
| 46 #include "chrome/browser/printing/background_printing_manager.h" |
| 44 #include "chrome/browser/printing/print_job_manager.h" | 47 #include "chrome/browser/printing/print_job_manager.h" |
| 45 #include "chrome/browser/printing/print_preview_tab_controller.h" | 48 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 46 #include "chrome/browser/profiles/profile_manager.h" | 49 #include "chrome/browser/profiles/profile_manager.h" |
| 47 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 50 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 48 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 51 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 49 #include "chrome/browser/shell_integration.h" | 52 #include "chrome/browser/shell_integration.h" |
| 50 #include "chrome/browser/sidebar/sidebar_manager.h" | 53 #include "chrome/browser/sidebar/sidebar_manager.h" |
| 51 #include "chrome/browser/tab_closeable_state_watcher.h" | 54 #include "chrome/browser/tab_closeable_state_watcher.h" |
| 52 #include "chrome/browser/ui/browser_list.h" | 55 #include "chrome/browser/ui/browser_list.h" |
| 53 #include "chrome/common/chrome_constants.h" | 56 #include "chrome/common/chrome_constants.h" |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 557 } |
| 555 | 558 |
| 556 printing::PrintPreviewTabController* | 559 printing::PrintPreviewTabController* |
| 557 BrowserProcessImpl::print_preview_tab_controller() { | 560 BrowserProcessImpl::print_preview_tab_controller() { |
| 558 DCHECK(CalledOnValidThread()); | 561 DCHECK(CalledOnValidThread()); |
| 559 if (!print_preview_tab_controller_.get()) | 562 if (!print_preview_tab_controller_.get()) |
| 560 CreatePrintPreviewTabController(); | 563 CreatePrintPreviewTabController(); |
| 561 return print_preview_tab_controller_.get(); | 564 return print_preview_tab_controller_.get(); |
| 562 } | 565 } |
| 563 | 566 |
| 567 printing::BackgroundPrintingManager* |
| 568 BrowserProcessImpl::background_printing_manager() { |
| 569 DCHECK(CalledOnValidThread()); |
| 570 if (!background_printing_manager_.get()) |
| 571 CreateBackgroundPrintingManager(); |
| 572 return background_printing_manager_.get(); |
| 573 } |
| 574 |
| 564 GoogleURLTracker* BrowserProcessImpl::google_url_tracker() { | 575 GoogleURLTracker* BrowserProcessImpl::google_url_tracker() { |
| 565 DCHECK(CalledOnValidThread()); | 576 DCHECK(CalledOnValidThread()); |
| 566 if (!google_url_tracker_.get()) | 577 if (!google_url_tracker_.get()) |
| 567 CreateGoogleURLTracker(); | 578 CreateGoogleURLTracker(); |
| 568 return google_url_tracker_.get(); | 579 return google_url_tracker_.get(); |
| 569 } | 580 } |
| 570 | 581 |
| 571 IntranetRedirectDetector* BrowserProcessImpl::intranet_redirect_detector() { | 582 IntranetRedirectDetector* BrowserProcessImpl::intranet_redirect_detector() { |
| 572 DCHECK(CalledOnValidThread()); | 583 DCHECK(CalledOnValidThread()); |
| 573 if (!intranet_redirect_detector_.get()) | 584 if (!intranet_redirect_detector_.get()) |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 void BrowserProcessImpl::CreateTabCloseableStateWatcher() { | 917 void BrowserProcessImpl::CreateTabCloseableStateWatcher() { |
| 907 DCHECK(tab_closeable_state_watcher_.get() == NULL); | 918 DCHECK(tab_closeable_state_watcher_.get() == NULL); |
| 908 tab_closeable_state_watcher_.reset(TabCloseableStateWatcher::Create()); | 919 tab_closeable_state_watcher_.reset(TabCloseableStateWatcher::Create()); |
| 909 } | 920 } |
| 910 | 921 |
| 911 void BrowserProcessImpl::CreatePrintPreviewTabController() { | 922 void BrowserProcessImpl::CreatePrintPreviewTabController() { |
| 912 DCHECK(print_preview_tab_controller_.get() == NULL); | 923 DCHECK(print_preview_tab_controller_.get() == NULL); |
| 913 print_preview_tab_controller_ = new printing::PrintPreviewTabController(); | 924 print_preview_tab_controller_ = new printing::PrintPreviewTabController(); |
| 914 } | 925 } |
| 915 | 926 |
| 927 void BrowserProcessImpl::CreateBackgroundPrintingManager() { |
| 928 DCHECK(background_printing_manager_.get() == NULL); |
| 929 background_printing_manager_ = new printing::BackgroundPrintingManager(); |
| 930 } |
| 931 |
| 916 void BrowserProcessImpl::CreateSafeBrowsingDetectionService() { | 932 void BrowserProcessImpl::CreateSafeBrowsingDetectionService() { |
| 917 DCHECK(safe_browsing_detection_service_.get() == NULL); | 933 DCHECK(safe_browsing_detection_service_.get() == NULL); |
| 918 // Set this flag to true so that we don't retry indefinitely to | 934 // Set this flag to true so that we don't retry indefinitely to |
| 919 // create the service class if there was an error. | 935 // create the service class if there was an error. |
| 920 created_safe_browsing_detection_service_ = true; | 936 created_safe_browsing_detection_service_ = true; |
| 921 | 937 |
| 922 FilePath model_file_path; | 938 FilePath model_file_path; |
| 923 Profile* profile = profile_manager() ? | 939 Profile* profile = profile_manager() ? |
| 924 profile_manager()->GetDefaultProfile() : NULL; | 940 profile_manager()->GetDefaultProfile() : NULL; |
| 925 if (IsSafeBrowsingDetectionServiceEnabled() && | 941 if (IsSafeBrowsingDetectionServiceEnabled() && |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 } | 1065 } |
| 1050 | 1066 |
| 1051 void BrowserProcessImpl::OnAutoupdateTimer() { | 1067 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1052 if (CanAutorestartForUpdate()) { | 1068 if (CanAutorestartForUpdate()) { |
| 1053 DLOG(WARNING) << "Detected update. Restarting browser."; | 1069 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1054 RestartPersistentInstance(); | 1070 RestartPersistentInstance(); |
| 1055 } | 1071 } |
| 1056 } | 1072 } |
| 1057 | 1073 |
| 1058 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1074 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |