| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_BROWSER_MAIN_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_MAIN_H_ |
| 6 #define CHROME_BROWSER_BROWSER_MAIN_H_ | 6 #define CHROME_BROWSER_BROWSER_MAIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/tracked_objects.h" | 12 #include "base/tracked_objects.h" |
| 13 | 13 |
| 14 class BrowserThread; | 14 class BrowserThread; |
| 15 class CommandLine; | 15 class CommandLine; |
| 16 class HighResolutionTimerManager; | 16 class HighResolutionTimerManager; |
| 17 struct MainFunctionParams; | 17 struct MainFunctionParams; |
| 18 class MessageLoop; | 18 class MessageLoop; |
| 19 class MetricsService; | 19 class MetricsService; |
| 20 class SystemMonitor; | |
| 21 | 20 |
| 22 namespace net { | 21 namespace net { |
| 23 class NetworkChangeNotifier; | 22 class NetworkChangeNotifier; |
| 24 } | 23 } |
| 25 | 24 |
| 25 namespace ui { |
| 26 class SystemMonitor; |
| 27 } |
| 28 |
| 26 // BrowserMainParts: | 29 // BrowserMainParts: |
| 27 // This class contains different "stages" to be executed in |BrowserMain()|, | 30 // This class contains different "stages" to be executed in |BrowserMain()|, |
| 28 // mostly initialization. This is made into a class rather than just functions | 31 // mostly initialization. This is made into a class rather than just functions |
| 29 // so each stage can create and maintain state. Each part is represented by a | 32 // so each stage can create and maintain state. Each part is represented by a |
| 30 // single method (e.g., "EarlyInitialization()"), which does the following: | 33 // single method (e.g., "EarlyInitialization()"), which does the following: |
| 31 // - calls a method (e.g., "PreEarlyInitialization()") which individual | 34 // - calls a method (e.g., "PreEarlyInitialization()") which individual |
| 32 // platforms can override to provide platform-specific code which is to be | 35 // platforms can override to provide platform-specific code which is to be |
| 33 // executed before the common code; | 36 // executed before the common code; |
| 34 // - calls various methods for things common to all platforms (for that given | 37 // - calls various methods for things common to all platforms (for that given |
| 35 // stage); and | 38 // stage); and |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // instance. This MUST be done before main_message_loop, so that it is | 140 // instance. This MUST be done before main_message_loop, so that it is |
| 138 // destroyed after the main_message_loop. | 141 // destroyed after the main_message_loop. |
| 139 tracked_objects::AutoTracking tracking_objects_; | 142 tracked_objects::AutoTracking tracking_objects_; |
| 140 #endif | 143 #endif |
| 141 | 144 |
| 142 // Statistical testing infrastructure for the entire browser. | 145 // Statistical testing infrastructure for the entire browser. |
| 143 base::FieldTrialList field_trial_; | 146 base::FieldTrialList field_trial_; |
| 144 | 147 |
| 145 // Members initialized in |MainMessageLoopStart()| --------------------------- | 148 // Members initialized in |MainMessageLoopStart()| --------------------------- |
| 146 scoped_ptr<MessageLoop> main_message_loop_; | 149 scoped_ptr<MessageLoop> main_message_loop_; |
| 147 scoped_ptr<SystemMonitor> system_monitor_; | 150 scoped_ptr<ui::SystemMonitor> system_monitor_; |
| 148 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; | 151 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; |
| 149 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 152 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
| 150 scoped_ptr<BrowserThread> main_thread_; | 153 scoped_ptr<BrowserThread> main_thread_; |
| 151 | 154 |
| 152 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); | 155 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); |
| 153 }; | 156 }; |
| 154 | 157 |
| 155 | 158 |
| 156 // Perform platform-specific work that needs to be done after the main event | 159 // Perform platform-specific work that needs to be done after the main event |
| 157 // loop has ended. | 160 // loop has ended. |
| 158 void DidEndMainMessageLoop(); | 161 void DidEndMainMessageLoop(); |
| 159 | 162 |
| 160 // Records the conditions that can prevent Breakpad from generating and | 163 // Records the conditions that can prevent Breakpad from generating and |
| 161 // sending crash reports. The presence of a Breakpad handler (after | 164 // sending crash reports. The presence of a Breakpad handler (after |
| 162 // attempting to initialize crash reporting) and the presence of a debugger | 165 // attempting to initialize crash reporting) and the presence of a debugger |
| 163 // are registered with the UMA metrics service. | 166 // are registered with the UMA metrics service. |
| 164 void RecordBreakpadStatusUMA(MetricsService* metrics); | 167 void RecordBreakpadStatusUMA(MetricsService* metrics); |
| 165 | 168 |
| 166 // Displays a warning message if some minimum level of OS support is not | 169 // Displays a warning message if some minimum level of OS support is not |
| 167 // present on the current platform. | 170 // present on the current platform. |
| 168 void WarnAboutMinimumSystemRequirements(); | 171 void WarnAboutMinimumSystemRequirements(); |
| 169 | 172 |
| 170 #endif // CHROME_BROWSER_BROWSER_MAIN_H_ | 173 #endif // CHROME_BROWSER_BROWSER_MAIN_H_ |
| OLD | NEW |