summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/constrained_window_impl.h
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:12:18 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:12:18 +0000
commit0f2f4b60511540e292e085ba5e1985be6bf93908 (patch)
tree6d6bb042fe78bb23c4eca3cf4a4222a3dab38e74 /chrome/browser/views/constrained_window_impl.h
parentaaeb9dc745d49afa66c1b613daa5a3123f309955 (diff)
downloadchromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.zip
chromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.tar.gz
chromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.tar.bz2
Window Delegate Improvements:
- Windows now must have a Delegate. Just construct the default WindowDelegate if you don't want to have to write one in testing. - Windows now obtain their contents view by asking the delegate via WindowDelegate::GetContentsView. - Contents views no longer need to manually store a pointer to the Window that contains them, WindowDelegate does this automatically via its window() accessor. Reviewer notes: - review window_delegate.h first, then - window.h/cc - custom frame window.h/cc - constrained_window_impl.h/cc - then everything else (just updating all call sites) B=1280060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/constrained_window_impl.h')
-rw-r--r--chrome/browser/views/constrained_window_impl.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/chrome/browser/views/constrained_window_impl.h b/chrome/browser/views/constrained_window_impl.h
index f3916ab..9e8c0b3 100644
--- a/chrome/browser/views/constrained_window_impl.h
+++ b/chrome/browser/views/constrained_window_impl.h
@@ -73,11 +73,13 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
virtual void UpdateWindowTitle();
virtual const gfx::Rect& GetCurrentBounds() const;
- // Overridden from TabContentsDelegate:
+ // Overridden from PageNavigator (TabContentsDelegate's base interface):
virtual void OpenURLFromTab(TabContents* source,
const GURL& url,
WindowOpenDisposition disposition,
PageTransition::Type transition);
+
+ // Overridden from TabContentsDelegate:
virtual void NavigationStateChanged(const TabContents* source,
unsigned changed_flags);
virtual void ReplaceContents(TabContents* source,
@@ -123,7 +125,12 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
private:
// Use the static factory methods on ConstrainedWindow to construct a
// ConstrainedWindow.
- ConstrainedWindowImpl(TabContents* owner);
+ ConstrainedWindowImpl(TabContents* owner,
+ ChromeViews::WindowDelegate* window_delegate,
+ TabContents* constrained_contents);
+ ConstrainedWindowImpl(TabContents* owner,
+ ChromeViews::WindowDelegate* window_delegate);
+ void Init(TabContents* owner);
friend class ConstrainedWindow;
@@ -136,9 +143,7 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
// Initialize the Constrained Window as a Constrained Dialog containing a
// ChromeViews::View client area.
- void InitAsDialog(const gfx::Rect& initial_bounds,
- ChromeViews::View* contents_view,
- ChromeViews::WindowDelegate* window_delegate);
+ void InitAsDialog(const gfx::Rect& initial_bounds);
// Builds the underlying HWND and window delegates for a newly
// created popup window.
@@ -148,7 +153,8 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
// so that when we query for desired size, we get accurate data. If
// we didn't do this, windows will initialize to being smaller then
// the desired content size plus room for browser chrome.
- void InitWindowForContents(TabContents* constrained_contents);
+ void InitWindowForContents(TabContents* constrained_contents,
+ ConstrainedTabContentsWindowDelegate* delegate);
// Sets the initial bounds for a newly created popup window.
//
@@ -183,7 +189,7 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
// A default ChromeViews::WindowDelegate implementation for this window when
// a TabContents is being constrained. (For the Constrained Dialog case, the
// caller is required to provide the WindowDelegate).
- scoped_ptr<ConstrainedTabContentsWindowDelegate> contents_window_delegate_;
+ scoped_ptr<ChromeViews::WindowDelegate> contents_window_delegate_;
// We keep a reference on the HWNDView so we can properly detach the tab
// contents when detaching.