| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/metrics/variations_service.h" | 39 #include "chrome/browser/metrics/variations_service.h" |
| 40 #include "chrome/browser/net/chrome_net_log.h" | 40 #include "chrome/browser/net/chrome_net_log.h" |
| 41 #include "chrome/browser/net/crl_set_fetcher.h" | 41 #include "chrome/browser/net/crl_set_fetcher.h" |
| 42 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 42 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 43 #include "chrome/browser/notifications/notification_ui_manager.h" | 43 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 44 #include "chrome/browser/policy/browser_policy_connector.h" | 44 #include "chrome/browser/policy/browser_policy_connector.h" |
| 45 #include "chrome/browser/policy/policy_service_impl.h" | 45 #include "chrome/browser/policy/policy_service_impl.h" |
| 46 #include "chrome/browser/policy/policy_service_stub.h" | 46 #include "chrome/browser/policy/policy_service_stub.h" |
| 47 #include "chrome/browser/prefs/browser_prefs.h" | 47 #include "chrome/browser/prefs/browser_prefs.h" |
| 48 #include "chrome/browser/prefs/pref_service.h" | 48 #include "chrome/browser/prefs/pref_service.h" |
| 49 #include "chrome/browser/prerender/prerender_tracker.h" | 49 #include "chrome/browser/prerender/prerender_render_view_tracker.h" |
| 50 #include "chrome/browser/printing/background_printing_manager.h" | 50 #include "chrome/browser/printing/background_printing_manager.h" |
| 51 #include "chrome/browser/printing/print_job_manager.h" | 51 #include "chrome/browser/printing/print_job_manager.h" |
| 52 #include "chrome/browser/printing/print_preview_tab_controller.h" | 52 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 53 #include "chrome/browser/profiles/profile_manager.h" | 53 #include "chrome/browser/profiles/profile_manager.h" |
| 54 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" | 54 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
| 55 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 55 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 56 #include "chrome/browser/shell_integration.h" | 56 #include "chrome/browser/shell_integration.h" |
| 57 #include "chrome/browser/status_icons/status_tray.h" | 57 #include "chrome/browser/status_icons/status_tray.h" |
| 58 #include "chrome/browser/tab_closeable_state_watcher.h" | 58 #include "chrome/browser/tab_closeable_state_watcher.h" |
| 59 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 59 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), | 616 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), |
| 617 this, | 617 this, |
| 618 &BrowserProcessImpl::OnAutoupdateTimer); | 618 &BrowserProcessImpl::OnAutoupdateTimer); |
| 619 } | 619 } |
| 620 #endif | 620 #endif |
| 621 | 621 |
| 622 ChromeNetLog* BrowserProcessImpl::net_log() { | 622 ChromeNetLog* BrowserProcessImpl::net_log() { |
| 623 return net_log_.get(); | 623 return net_log_.get(); |
| 624 } | 624 } |
| 625 | 625 |
| 626 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() { | 626 prerender::PrerenderRenderViewTracker* |
| 627 if (!prerender_tracker_.get()) | 627 BrowserProcessImpl::prerender_render_view_tracker() { |
| 628 prerender_tracker_.reset(new prerender::PrerenderTracker); | 628 if (!prerender_render_view_tracker_.get()) { |
| 629 | 629 prerender_render_view_tracker_.reset( |
| 630 return prerender_tracker_.get(); | 630 new prerender::PrerenderRenderViewTracker); |
| 631 } |
| 632 return prerender_render_view_tracker_.get(); |
| 631 } | 633 } |
| 632 | 634 |
| 633 ComponentUpdateService* BrowserProcessImpl::component_updater() { | 635 ComponentUpdateService* BrowserProcessImpl::component_updater() { |
| 634 #if defined(OS_CHROMEOS) | 636 #if defined(OS_CHROMEOS) |
| 635 return NULL; | 637 return NULL; |
| 636 #else | 638 #else |
| 637 if (!component_updater_.get()) { | 639 if (!component_updater_.get()) { |
| 638 ComponentUpdateService::Configurator* configurator = | 640 ComponentUpdateService::Configurator* configurator = |
| 639 MakeChromeComponentUpdaterConfigurator( | 641 MakeChromeComponentUpdaterConfigurator( |
| 640 CommandLine::ForCurrentProcess(), | 642 CommandLine::ForCurrentProcess(), |
| (...skipping 14 matching lines...) Expand all Loading... |
| 655 #else | 657 #else |
| 656 if (!crl_set_fetcher_.get()) { | 658 if (!crl_set_fetcher_.get()) { |
| 657 crl_set_fetcher_ = new CRLSetFetcher(); | 659 crl_set_fetcher_ = new CRLSetFetcher(); |
| 658 } | 660 } |
| 659 return crl_set_fetcher_.get(); | 661 return crl_set_fetcher_.get(); |
| 660 #endif | 662 #endif |
| 661 } | 663 } |
| 662 | 664 |
| 663 void BrowserProcessImpl::ResourceDispatcherHostCreated() { | 665 void BrowserProcessImpl::ResourceDispatcherHostCreated() { |
| 664 resource_dispatcher_host_delegate_.reset( | 666 resource_dispatcher_host_delegate_.reset( |
| 665 new ChromeResourceDispatcherHostDelegate(prerender_tracker())); | 667 new ChromeResourceDispatcherHostDelegate( |
| 668 prerender_render_view_tracker())); |
| 666 ResourceDispatcherHost::Get()->SetDelegate( | 669 ResourceDispatcherHost::Get()->SetDelegate( |
| 667 resource_dispatcher_host_delegate_.get()); | 670 resource_dispatcher_host_delegate_.get()); |
| 668 | 671 |
| 669 pref_change_registrar_.Add(prefs::kAllowCrossOriginAuthPrompt, this); | 672 pref_change_registrar_.Add(prefs::kAllowCrossOriginAuthPrompt, this); |
| 670 ApplyAllowCrossOriginAuthPromptPolicy(); | 673 ApplyAllowCrossOriginAuthPromptPolicy(); |
| 671 } | 674 } |
| 672 | 675 |
| 673 void BrowserProcessImpl::CreateMetricsService() { | 676 void BrowserProcessImpl::CreateMetricsService() { |
| 674 DCHECK(!created_metrics_service_ && metrics_service_.get() == NULL); | 677 DCHECK(!created_metrics_service_ && metrics_service_.get() == NULL); |
| 675 created_metrics_service_ = true; | 678 created_metrics_service_ = true; |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 } | 928 } |
| 926 | 929 |
| 927 void BrowserProcessImpl::OnAutoupdateTimer() { | 930 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 928 if (CanAutorestartForUpdate()) { | 931 if (CanAutorestartForUpdate()) { |
| 929 DLOG(WARNING) << "Detected update. Restarting browser."; | 932 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 930 RestartBackgroundInstance(); | 933 RestartBackgroundInstance(); |
| 931 } | 934 } |
| 932 } | 935 } |
| 933 | 936 |
| 934 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 937 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |