Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 812823002: Remove dependency of infobars component on the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests by instanciating a TestConfirmInfoBarDelegateFactory Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "chrome/browser/component_updater/flash_component_installer.h" 49 #include "chrome/browser/component_updater/flash_component_installer.h"
50 #include "chrome/browser/component_updater/recovery_component_installer.h" 50 #include "chrome/browser/component_updater/recovery_component_installer.h"
51 #include "chrome/browser/component_updater/swiftshader_component_installer.h" 51 #include "chrome/browser/component_updater/swiftshader_component_installer.h"
52 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" 52 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h"
53 #include "chrome/browser/defaults.h" 53 #include "chrome/browser/defaults.h"
54 #include "chrome/browser/first_run/first_run.h" 54 #include "chrome/browser/first_run/first_run.h"
55 #include "chrome/browser/first_run/upgrade_util.h" 55 #include "chrome/browser/first_run/upgrade_util.h"
56 #include "chrome/browser/google/google_search_counter.h" 56 #include "chrome/browser/google/google_search_counter.h"
57 #include "chrome/browser/gpu/gl_string_manager.h" 57 #include "chrome/browser/gpu/gl_string_manager.h"
58 #include "chrome/browser/gpu/three_d_api_observer.h" 58 #include "chrome/browser/gpu/three_d_api_observer.h"
59 #include "chrome/browser/infobars/chrome_confirm_infobar_delegate_factory.h"
59 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 60 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
60 #include "chrome/browser/metrics/field_trial_synchronizer.h" 61 #include "chrome/browser/metrics/field_trial_synchronizer.h"
61 #include "chrome/browser/metrics/thread_watcher.h" 62 #include "chrome/browser/metrics/thread_watcher.h"
62 #include "chrome/browser/metrics/variations/variations_service.h" 63 #include "chrome/browser/metrics/variations/variations_service.h"
63 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" 64 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
64 #include "chrome/browser/net/chrome_net_log.h" 65 #include "chrome/browser/net/chrome_net_log.h"
65 #include "chrome/browser/net/crl_set_fetcher.h" 66 #include "chrome/browser/net/crl_set_fetcher.h"
66 #include "chrome/browser/notifications/desktop_notification_service.h" 67 #include "chrome/browser/notifications/desktop_notification_service.h"
67 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 68 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
68 #include "chrome/browser/performance_monitor/performance_monitor.h" 69 #include "chrome/browser/performance_monitor/performance_monitor.h"
(...skipping 28 matching lines...) Expand all
97 #include "chrome/common/crash_keys.h" 98 #include "chrome/common/crash_keys.h"
98 #include "chrome/common/env_vars.h" 99 #include "chrome/common/env_vars.h"
99 #include "chrome/common/logging_chrome.h" 100 #include "chrome/common/logging_chrome.h"
100 #include "chrome/common/net/net_resource_provider.h" 101 #include "chrome/common/net/net_resource_provider.h"
101 #include "chrome/common/pref_names.h" 102 #include "chrome/common/pref_names.h"
102 #include "chrome/common/profiling.h" 103 #include "chrome/common/profiling.h"
103 #include "chrome/grit/generated_resources.h" 104 #include "chrome/grit/generated_resources.h"
104 #include "chrome/installer/util/google_update_settings.h" 105 #include "chrome/installer/util/google_update_settings.h"
105 #include "components/component_updater/component_updater_service.h" 106 #include "components/component_updater/component_updater_service.h"
106 #include "components/google/core/browser/google_util.h" 107 #include "components/google/core/browser/google_util.h"
108 #include "components/infobars/core/confirm_infobar_delegate_factory.h"
107 #include "components/language_usage_metrics/language_usage_metrics.h" 109 #include "components/language_usage_metrics/language_usage_metrics.h"
108 #include "components/metrics/metrics_service.h" 110 #include "components/metrics/metrics_service.h"
109 #include "components/metrics/profiler/tracking_synchronizer.h" 111 #include "components/metrics/profiler/tracking_synchronizer.h"
110 #include "components/nacl/browser/nacl_browser.h" 112 #include "components/nacl/browser/nacl_browser.h"
111 #include "components/rappor/rappor_service.h" 113 #include "components/rappor/rappor_service.h"
112 #include "components/signin/core/common/profile_management_switches.h" 114 #include "components/signin/core/common/profile_management_switches.h"
113 #include "components/startup_metric_utils/startup_metric_utils.h" 115 #include "components/startup_metric_utils/startup_metric_utils.h"
114 #include "components/translate/content/browser/browser_cld_utils.h" 116 #include "components/translate/content/browser/browser_cld_utils.h"
115 #include "components/translate/content/common/cld_data_source.h" 117 #include "components/translate/content/common/cld_data_source.h"
116 #include "components/translate/core/browser/translate_download_manager.h" 118 #include "components/translate/core/browser/translate_download_manager.h"
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 #endif // !defined(OS_ANDROID) 1302 #endif // !defined(OS_ANDROID)
1301 1303
1302 #if defined(ENABLE_BACKGROUND) 1304 #if defined(ENABLE_BACKGROUND)
1303 // Autoload any profiles which are running background apps. 1305 // Autoload any profiles which are running background apps.
1304 // TODO(rlp): Do this on a separate thread. See http://crbug.com/99075. 1306 // TODO(rlp): Do this on a separate thread. See http://crbug.com/99075.
1305 browser_process_->profile_manager()->AutoloadProfiles(); 1307 browser_process_->profile_manager()->AutoloadProfiles();
1306 #endif 1308 #endif
1307 // Post-profile init --------------------------------------------------------- 1309 // Post-profile init ---------------------------------------------------------
1308 1310
1309 TranslateService::Initialize(); 1311 TranslateService::Initialize();
1312 ConfirmInfoBarDelegateFactory::SetInstance(
1313 ChromeConfirmInfoBarDelegateFactory::GetInstance());
1310 1314
1311 // Needs to be done before PostProfileInit, since login manager on CrOS is 1315 // Needs to be done before PostProfileInit, since login manager on CrOS is
1312 // called inside PostProfileInit. 1316 // called inside PostProfileInit.
1313 content::WebUIControllerFactory::RegisterFactory( 1317 content::WebUIControllerFactory::RegisterFactory(
1314 ChromeWebUIControllerFactory::GetInstance()); 1318 ChromeWebUIControllerFactory::GetInstance());
1315 1319
1316 // NaClBrowserDelegateImpl is accessed inside PostProfileInit(). 1320 // NaClBrowserDelegateImpl is accessed inside PostProfileInit().
1317 // So make sure to create it before that. 1321 // So make sure to create it before that.
1318 #if !defined(DISABLE_NACL) 1322 #if !defined(DISABLE_NACL)
1319 NaClBrowserDelegateImpl* delegate = 1323 NaClBrowserDelegateImpl* delegate =
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 // shut down. 1681 // shut down.
1678 process_power_collector_.reset(); 1682 process_power_collector_.reset();
1679 1683
1680 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 1684 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
1681 chrome_extra_parts_[i]->PostMainMessageLoopRun(); 1685 chrome_extra_parts_[i]->PostMainMessageLoopRun();
1682 1686
1683 // Some tests don't set parameters.ui_task, so they started translate 1687 // Some tests don't set parameters.ui_task, so they started translate
1684 // language fetch that was never completed so we need to cleanup here 1688 // language fetch that was never completed so we need to cleanup here
1685 // otherwise it will be done by the destructor in a wrong thread. 1689 // otherwise it will be done by the destructor in a wrong thread.
1686 TranslateService::Shutdown(parameters().ui_task == NULL); 1690 TranslateService::Shutdown(parameters().ui_task == NULL);
1691 ConfirmInfoBarDelegateFactory::SetInstance(nullptr);
1687 1692
1688 if (notify_result_ == ProcessSingleton::PROCESS_NONE) 1693 if (notify_result_ == ProcessSingleton::PROCESS_NONE)
1689 process_singleton_->Cleanup(); 1694 process_singleton_->Cleanup();
1690 1695
1691 // Stop all tasks that might run on WatchDogThread. 1696 // Stop all tasks that might run on WatchDogThread.
1692 ThreadWatcherList::StopWatchingAll(); 1697 ThreadWatcherList::StopWatchingAll();
1693 1698
1694 browser_process_->metrics_service()->Stop(); 1699 browser_process_->metrics_service()->Stop();
1695 1700
1696 restart_last_session_ = browser_shutdown::ShutdownPreThreadsStop(); 1701 restart_last_session_ = browser_shutdown::ShutdownPreThreadsStop();
(...skipping 26 matching lines...) Expand all
1723 chromeos::CrosSettings::Shutdown(); 1728 chromeos::CrosSettings::Shutdown();
1724 #endif 1729 #endif
1725 #endif 1730 #endif
1726 } 1731 }
1727 1732
1728 // Public members: 1733 // Public members:
1729 1734
1730 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1735 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1731 chrome_extra_parts_.push_back(parts); 1736 chrome_extra_parts_.push_back(parts);
1732 } 1737 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698