Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: chrome/browser/ui/browser.h

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.h
===================================================================
--- chrome/browser/ui/browser.h (revision 148382)
+++ chrome/browser/ui/browser.h (working copy)
@@ -155,6 +155,7 @@
struct CreateParams {
CreateParams();
+ explicit CreateParams(Profile* profile);
CreateParams(Type type, Profile* profile);
static CreateParams CreateForApp(Type type,
@@ -185,25 +186,17 @@
ui::WindowShowState initial_show_state;
bool is_session_restore;
+
+ // Supply a custom BrowserWindow implementation, to be used instead of the
+ // default. Intended for testing.
+ BrowserWindow* window;
};
// Constructors, Creation, Showing //////////////////////////////////////////
- // Creates a new browser of the given |type| and for the given |profile|. The
- // Browser has a NULL window after its construction, InitBrowserWindow must
- // be called after configuration for window() to be valid.
- // Avoid using this constructor directly if you can use one of the Create*()
- // methods below. This applies to almost all non-testing code.
- Browser(Type type, Profile* profile);
+ explicit Browser(const CreateParams& params);
virtual ~Browser();
- // Creates a normal tabbed browser with the specified profile. The Browser's
- // window is created by this function call.
- static Browser* Create(Profile* profile);
-
- // Like Create, but creates a browser of the specified parameters.
- static Browser* CreateWithParams(const CreateParams& params);
-
// Set overrides for the initial window bounds and maximized state.
void set_override_bounds(const gfx::Rect& bounds) {
override_bounds_ = bounds;
@@ -226,16 +219,6 @@
return is_session_restore_;
}
- // Creates the Browser Window. Prefer to use the static helpers above where
- // possible. This does not show the window. You need to call window()->Show()
- // to show it.
- void InitBrowserWindow();
-
- // Sets the BrowserWindow. This is intended for tests only.
- // Use CreateBrowserWindow outside of testing, or the static convenience
- // methods that create a BrowserWindow for you.
- void SetWindowForTesting(BrowserWindow* window);
-
// Accessors ////////////////////////////////////////////////////////////////
Type type() const { return type_; }
@@ -484,11 +467,6 @@
return extension_window_controller_.get();
}
- protected:
- // Funnel for the factory method in BrowserWindow. This allows subclasses to
- // set their own window.
- virtual BrowserWindow* CreateBrowserWindow();
-
private:
friend class BrowserTest;
friend class FullscreenControllerTest;
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698