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 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ | 5 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ |
6 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ | 6 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
11 #include "base/tracked_objects.h" | 11 #include "base/tracked_objects.h" |
12 #include "chrome/browser/chrome_browser_field_trials.h" | 12 #include "chrome/browser/chrome_browser_field_trials.h" |
13 #include "chrome/browser/chrome_process_singleton.h" | 13 #include "chrome/browser/chrome_process_singleton.h" |
14 #include "chrome/browser/first_run/first_run.h" | 14 #include "chrome/browser/first_run/first_run.h" |
15 #include "chrome/browser/process_singleton.h" | 15 #include "chrome/browser/process_singleton.h" |
16 #include "chrome/browser/task_profiler/auto_tracking.h" | 16 #include "chrome/browser/task_profiler/auto_tracking.h" |
17 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 17 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
18 #include "content/public/browser/browser_main_parts.h" | 18 #include "content/public/browser/browser_main_parts.h" |
19 #include "content/public/browser/render_view_host.h" | 19 #include "content/public/browser/render_view_host.h" |
| 20 #include "content/public/common/main_function_params.h" |
20 | 21 |
21 class ActiveTabTracker; | 22 class ActiveTabTracker; |
22 class BrowserProcessImpl; | 23 class BrowserProcessImpl; |
23 class ChromeBrowserMainExtraParts; | 24 class ChromeBrowserMainExtraParts; |
24 class FieldTrialSynchronizer; | 25 class FieldTrialSynchronizer; |
25 class MetricsService; | 26 class MetricsService; |
26 class PrefService; | 27 class PrefService; |
27 class Profile; | 28 class Profile; |
28 class StartupBrowserCreator; | 29 class StartupBrowserCreator; |
29 class StartupTimeBomb; | 30 class StartupTimeBomb; |
30 class ShutdownWatcherHelper; | 31 class ShutdownWatcherHelper; |
31 class ThreeDAPIObserver; | 32 class ThreeDAPIObserver; |
32 class TranslateManager; | 33 class TranslateManager; |
33 | 34 |
34 namespace chrome_browser { | 35 namespace chrome_browser { |
35 // For use by ShowMissingLocaleMessageBox. | 36 // For use by ShowMissingLocaleMessageBox. |
36 extern const char kMissingLocaleDataTitle[]; | 37 extern const char kMissingLocaleDataTitle[]; |
37 extern const char kMissingLocaleDataMessage[]; | 38 extern const char kMissingLocaleDataMessage[]; |
38 } | 39 } |
39 | 40 |
40 namespace chrome_browser_metrics { | 41 namespace chrome_browser_metrics { |
41 class TrackingSynchronizer; | 42 class TrackingSynchronizer; |
42 } | 43 } |
43 | 44 |
44 namespace content { | |
45 struct MainFunctionParams; | |
46 } | |
47 | |
48 namespace performance_monitor { | 45 namespace performance_monitor { |
49 class StartupTimer; | 46 class StartupTimer; |
50 } | 47 } |
51 | 48 |
52 class ChromeBrowserMainParts : public content::BrowserMainParts { | 49 class ChromeBrowserMainParts : public content::BrowserMainParts { |
53 public: | 50 public: |
54 virtual ~ChromeBrowserMainParts(); | 51 virtual ~ChromeBrowserMainParts(); |
55 | 52 |
56 // Add additional ChromeBrowserMainExtraParts. | 53 // Add additional ChromeBrowserMainExtraParts. |
57 virtual void AddParts(ChromeBrowserMainExtraParts* parts); | 54 virtual void AddParts(ChromeBrowserMainExtraParts* parts); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // sub-histogram (_PreRead(Enabled|Disabled)). | 124 // sub-histogram (_PreRead(Enabled|Disabled)). |
128 void RecordPreReadExperimentTime(const char* name, base::TimeDelta time); | 125 void RecordPreReadExperimentTime(const char* name, base::TimeDelta time); |
129 | 126 |
130 // Methods for Main Message Loop ------------------------------------------- | 127 // Methods for Main Message Loop ------------------------------------------- |
131 | 128 |
132 int PreCreateThreadsImpl(); | 129 int PreCreateThreadsImpl(); |
133 int PreMainMessageLoopRunImpl(); | 130 int PreMainMessageLoopRunImpl(); |
134 | 131 |
135 // Members initialized on construction --------------------------------------- | 132 // Members initialized on construction --------------------------------------- |
136 | 133 |
137 const content::MainFunctionParams& parameters_; | 134 const content::MainFunctionParams parameters_; |
138 const CommandLine& parsed_command_line_; | 135 const CommandLine& parsed_command_line_; |
139 int result_code_; | 136 int result_code_; |
140 | 137 |
141 // Create StartupTimeBomb object for watching jank during startup. | 138 // Create StartupTimeBomb object for watching jank during startup. |
142 scoped_ptr<StartupTimeBomb> startup_watcher_; | 139 scoped_ptr<StartupTimeBomb> startup_watcher_; |
143 | 140 |
144 // Create ShutdownWatcherHelper object for watching jank during shutdown. | 141 // Create ShutdownWatcherHelper object for watching jank during shutdown. |
145 // Please keep |shutdown_watcher| as the first object constructed, and hence | 142 // Please keep |shutdown_watcher| as the first object constructed, and hence |
146 // it is destroyed last. | 143 // it is destroyed last. |
147 scoped_ptr<ShutdownWatcherHelper> shutdown_watcher_; | 144 scoped_ptr<ShutdownWatcherHelper> shutdown_watcher_; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 bool restart_last_session_; | 201 bool restart_last_session_; |
205 | 202 |
206 // Tests can set this to true to disable restricting cookie access in the | 203 // Tests can set this to true to disable restricting cookie access in the |
207 // network stack, as this can only be done once. | 204 // network stack, as this can only be done once. |
208 static bool disable_enforcing_cookie_policies_for_tests_; | 205 static bool disable_enforcing_cookie_policies_for_tests_; |
209 | 206 |
210 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainParts); | 207 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainParts); |
211 }; | 208 }; |
212 | 209 |
213 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ | 210 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ |
OLD | NEW |