summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_browser_main.h
diff options
context:
space:
mode:
authorstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 18:03:30 +0000
committerstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 18:03:30 +0000
commitb48c918f8397747d9a157a87a5cfc63eeed74710 (patch)
tree20bf06e2bb203915d5e135498538550d6b891e4f /chrome/browser/chrome_browser_main.h
parent45952868429c278087b68d0e0e96f33ec70388fa (diff)
downloadchromium_src-b48c918f8397747d9a157a87a5cfc63eeed74710.zip
chromium_src-b48c918f8397747d9a157a87a5cfc63eeed74710.tar.gz
chromium_src-b48c918f8397747d9a157a87a5cfc63eeed74710.tar.bz2
Make GTK and Aura parts orthogonal to OS parts
This CL moves GTK and Aura "Parts" out of the primary BrowserMainParts tree and into orthogonal parts that can be added independently. This was done in a way that will facilitate adding additional parts if (when) we need them. The motivation for this was to a) eliminate the existing typedef in chrome_browser_main_chromeos.h b) reduce the number of #ifdefs required in the setup / parts code For an outline of the new parts see: https://docs.google.com/drawings/d/1-gIMl-81c4SvcMrT1xaxnDGibDe7VQfMkFT1bMnIvrg/edit?hl=en_US Please consider this a proposal; I am entirely open to feedback. BUG=none TEST=Chrome compiles and passes tests on all platfroms. Review URL: http://codereview.chromium.org/8302016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107383 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_browser_main.h')
-rw-r--r--chrome/browser/chrome_browser_main.h41
1 files changed, 30 insertions, 11 deletions
diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h
index 95f2fea..817e8de 100644
--- a/chrome/browser/chrome_browser_main.h
+++ b/chrome/browser/chrome_browser_main.h
@@ -8,11 +8,12 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
+#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/tracked_objects.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/process_singleton.h"
-#include "content/browser/browser_main.h"
+#include "content/public/browser/browser_main_parts.h"
class BrowserProcessImpl;
class FieldTrialSynchronizer;
@@ -22,6 +23,7 @@ class PrefService;
class Profile;
class ShutdownWatcherHelper;
class TranslateManager;
+struct MainFunctionParams;
namespace chrome_browser {
// For use by ShowMissingLocaleMessageBox.
@@ -36,18 +38,30 @@ class ChromeBrowserMainParts : public content::BrowserMainParts {
// Constructs metrics service and does related initialization, including
// creation of field trials. Call only after labs have been converted to
// switches.
- MetricsService* SetupMetricsAndFieldTrials(
- const CommandLine& parsed_command_line,
- PrefService* local_state);
+ MetricsService* SetupMetricsAndFieldTrials(PrefService* local_state);
+
+ const MainFunctionParams& parameters() const {
+ return parameters_;
+ }
+ const CommandLine& parsed_command_line() const {
+ return parsed_command_line_;
+ }
protected:
explicit ChromeBrowserMainParts(const MainFunctionParams& parameters);
- virtual void PreMainMessageLoopRun() OVERRIDE;
- int PreMainMessageLoopRunInternal();
- virtual void MainMessageLoopRun() OVERRIDE;
- virtual void PostMainMessageLoopRun() OVERRIDE;
+ // content::BrowserParts overrides
+ virtual void PreEarlyInitialization() OVERRIDE {}
+ virtual void PostEarlyInitialization() OVERRIDE {}
+ virtual void PreMainMessageLoopStart() OVERRIDE {}
virtual void ToolkitInitialized() OVERRIDE;
+ virtual void PostMainMessageLoopStart() OVERRIDE {}
+ virtual void PreMainMessageLoopRun() OVERRIDE;
+ virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
+ virtual void PostMainMessageLoopRun();
+
+ // Displays a warning message that we can't find any locale data files.
+ virtual void ShowMissingLocaleMessageBox() = 0;
private:
// Methods for |EarlyInitialization()| ---------------------------------------
@@ -89,8 +103,16 @@ class ChromeBrowserMainParts : public content::BrowserMainParts {
void SetupFieldTrials(bool metrics_recording_enabled,
bool proxy_policy_is_set);
+ // Methods for Main Message Loop -------------------------------------------
+
+ int PreMainMessageLoopRunImpl();
+
// Members initialized on construction ---------------------------------------
+ const MainFunctionParams& parameters_;
+ const CommandLine& parsed_command_line_;
+ int result_code_;
+
// Create ShutdownWatcherHelper object for watching jank during shutdown.
// Please keep |shutdown_watcher| as the first object constructed, and hence
// it is destroyed last.
@@ -138,9 +160,6 @@ void RecordBreakpadStatusUMA(MetricsService* metrics);
// present on the current platform.
void WarnAboutMinimumSystemRequirements();
-// Displays a warning message that we can't find any locale data files.
-void ShowMissingLocaleMessageBox();
-
// Records the time from our process' startup to the present time in
// the UMA histogram |metric_name|.
void RecordBrowserStartupTime();