Index: chrome/browser/chrome_browser_main.h |
diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h |
index 95f2fea609beba0ee0069fbb29108542c978d8ff..a520b4dcd6db9e4ad224ccfa8a926aa2289e7910 100644 |
--- a/chrome/browser/chrome_browser_main.h |
+++ b/chrome/browser/chrome_browser_main.h |
@@ -8,6 +8,7 @@ |
#include "base/basictypes.h" |
#include "base/gtest_prod_util.h" |
+#include "base/memory/scoped_vector.h" |
#include "base/metrics/field_trial.h" |
#include "base/tracked_objects.h" |
#include "chrome/browser/first_run/first_run.h" |
@@ -33,6 +34,26 @@ class ChromeBrowserMainParts : public content::BrowserMainParts { |
public: |
virtual ~ChromeBrowserMainParts(); |
+ // Subclass to handle setup for parts orthagonal to the OS (GTK, Aura, etc). |
+ class ExtraParts { |
+ public: |
+ explicit ExtraParts(ChromeBrowserMainParts* main_parts); |
+ virtual ~ExtraParts(); |
+ |
+ virtual void PreEarlyInitialization(); |
+ virtual void PostEarlyInitialization(); |
+ virtual void PreMainMessageLoopRun(); |
+ virtual void PostMainMessageLoopRun(); |
+ |
+ protected: |
+ ChromeBrowserMainParts* main_parts() { return main_parts_; } |
+ |
+ private: |
+ ChromeBrowserMainParts* main_parts_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ExtraParts); |
+ }; |
+ |
// Constructs metrics service and does related initialization, including |
// creation of field trials. Call only after labs have been converted to |
// switches. |
@@ -43,13 +64,29 @@ class ChromeBrowserMainParts : public content::BrowserMainParts { |
protected: |
explicit ChromeBrowserMainParts(const MainFunctionParams& parameters); |
+ // content::BrowserMainParts overrides |
+ virtual void PreEarlyInitialization() OVERRIDE; |
+ virtual void PostEarlyInitialization() OVERRIDE; |
virtual void PreMainMessageLoopRun() OVERRIDE; |
- int PreMainMessageLoopRunInternal(); |
virtual void MainMessageLoopRun() OVERRIDE; |
virtual void PostMainMessageLoopRun() OVERRIDE; |
virtual void ToolkitInitialized() OVERRIDE; |
+ // New virtuals |
+ |
+ // Displays a warning message that we can't find any locale data files. |
+ virtual void ShowMissingLocaleMessageBox() = 0; |
+ // Handles the --hide-icons and --show-icons command line options. |
+ virtual int HandleIconsCommands() = 0; |
+ // Check if there is any machine level Chrome installed. If so, handle it |
+ // and return true. |
+ virtual bool CheckMachineLevelInstall() = 0; |
+ // Prepare localization, etc for handling crashes. |
+ virtual void PrepareRestartOnCrashEnviroment() = 0; |
+ |
private: |
+ int PreMainMessageLoopRunInternal(); |
+ |
// Methods for |EarlyInitialization()| --------------------------------------- |
// A/B test for the maximum number of persistent connections per host. |
@@ -107,6 +144,12 @@ class ChromeBrowserMainParts : public content::BrowserMainParts { |
// SetupMetricsAndFieldTrials is called. |
scoped_ptr<base::FieldTrialList> field_trial_list_; |
+ // Vector of extra parts instantiated in the constructor. |
+ // The virtual methods on each of these are called in the order added. |
+ // They are releaed (destroyed) in the opposite order. |
+ typedef ScopedVector<ExtraParts> PartsList; |
+ PartsList extra_parts_; |
+ |
// Members initialized after / released before main_message_loop_ ------------ |
scoped_ptr<BrowserProcessImpl> browser_process_; |
@@ -138,9 +181,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(); |