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-11-18 17:24:54 +0000
committerstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 17:24:54 +0000
commit12412170af3b2596b1a11984e5f5bcced7da3acf (patch)
tree40a9cab5279beeebd62ad7a37735f2ff86edbf8f /chrome/browser/chrome_browser_main.h
parent4a750007d8258df14df7a24c06e1636d941f2301 (diff)
downloadchromium_src-12412170af3b2596b1a11984e5f5bcced7da3acf.zip
chromium_src-12412170af3b2596b1a11984e5f5bcced7da3acf.tar.gz
chromium_src-12412170af3b2596b1a11984e5f5bcced7da3acf.tar.bz2
Add ChromeBrowserMainExtraParts for non main parts.
This was originally submitted as http://codereview.chromium.org/8539038/ which was reverted because of a failing test on win. This reverts the code back to a single instance of BrowserMainParts, with auxillary parts (Gtk, Views, Aura, Touch) implemented from a new base class, ChromeBrowserParts, which has a Chrome specific interface, allowing initialization to be better subdivided. This should fix the notifications auto tests. This CL also addresses the test failure on win (and a test failure on linux_chromeos triggered by the windows fix). BUG=103821 TEST=Make sure all tests and autotests run TBR=jam@chromium.org Review URL: http://codereview.chromium.org/8598005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_browser_main.h')
-rw-r--r--chrome/browser/chrome_browser_main.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h
index 867b14c..806af87 100644
--- a/chrome/browser/chrome_browser_main.h
+++ b/chrome/browser/chrome_browser_main.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.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"
@@ -17,6 +18,7 @@
class BrowserInit;
class BrowserProcessImpl;
+class ChromeBrowserMainExtraParts;
class FieldTrialSynchronizer;
class HistogramSynchronizer;
class MetricsService;
@@ -43,23 +45,14 @@ class ChromeBrowserMainParts : public content::BrowserMainParts {
public:
virtual ~ChromeBrowserMainParts();
- // Constructs metrics service and does related initialization, including
- // creation of field trials. Call only after labs have been converted to
- // switches.
- MetricsService* SetupMetricsAndFieldTrials(PrefService* local_state);
-
- const content::MainFunctionParams& parameters() const {
- return parameters_;
- }
- const CommandLine& parsed_command_line() const {
- return parsed_command_line_;
- }
+ // Add additional ChromeBrowserMainExtraParts.
+ virtual void AddParts(ChromeBrowserMainExtraParts* parts);
protected:
explicit ChromeBrowserMainParts(
const content::MainFunctionParams& parameters);
- // content::BrowserParts overrides
+ // content::BrowserMainParts overrides.
virtual void PreEarlyInitialization() OVERRIDE;
virtual void PostEarlyInitialization() OVERRIDE;
virtual void ToolkitInitialized() OVERRIDE;
@@ -72,6 +65,15 @@ class ChromeBrowserMainParts : public content::BrowserMainParts {
// Displays a warning message that we can't find any locale data files.
virtual void ShowMissingLocaleMessageBox() = 0;
+ const content::MainFunctionParams& parameters() const {
+ return parameters_;
+ }
+ const CommandLine& parsed_command_line() const {
+ return parsed_command_line_;
+ }
+
+ Profile* profile() { return profile_; }
+
private:
// Methods for |EarlyInitialization()| ---------------------------------------
@@ -104,6 +106,11 @@ class ChromeBrowserMainParts : public content::BrowserMainParts {
// Methods for |SetupMetricsAndFieldTrials()| --------------------------------
+ // Constructs metrics service and does related initialization, including
+ // creation of field trials. Call only after labs have been converted to
+ // switches.
+ MetricsService* SetupMetricsAndFieldTrials(PrefService* local_state);
+
static MetricsService* InitializeMetrics(
const CommandLine& parsed_command_line,
const PrefService* local_state);
@@ -115,7 +122,6 @@ class ChromeBrowserMainParts : public content::BrowserMainParts {
// Methods for Main Message Loop -------------------------------------------
int PreMainMessageLoopRunImpl();
- void StartBrowserOrUITask();
// Members initialized on construction ---------------------------------------
@@ -137,6 +143,10 @@ class ChromeBrowserMainParts : public content::BrowserMainParts {
// SetupMetricsAndFieldTrials is called.
scoped_ptr<base::FieldTrialList> field_trial_list_;
+ // Vector of additional ChromeBrowserMainExtraParts.
+ // Parts are deleted in the inverse order they are added.
+ std::vector<ChromeBrowserMainExtraParts*> chrome_extra_parts_;
+
// Members initialized after / released before main_message_loop_ ------------
scoped_ptr<BrowserInit> browser_init_;