summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/constrained_window_impl.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-05 19:03:25 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-05 19:03:25 +0000
commitd6598c050acb33ef7a64d32b116a6f10ba941329 (patch)
tree3e1e01c8a79b9e787f39fae834853b123d546276 /chrome/browser/views/constrained_window_impl.h
parent49a608d55bdb77491ea5dfe605a924fd1cb88d63 (diff)
downloadchromium_src-d6598c050acb33ef7a64d32b116a6f10ba941329.zip
chromium_src-d6598c050acb33ef7a64d32b116a6f10ba941329.tar.gz
chromium_src-d6598c050acb33ef7a64d32b116a6f10ba941329.tar.bz2
This is r4523, with a few changes to make things work under Vista.
- Explicitly set_delegate(NULL) before releasing a TabContents. (I think the order messages are getting handled is different from XP; this only seems neccessary under Vista.) - r4523 and someone elses change added entries to theme_resources.rc at roughly the same time, causing happy fun crashes. - Roll in sgk's SConscript fix. Review URL: http://codereview.chromium.org/9373 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/constrained_window_impl.h')
-rw-r--r--chrome/browser/views/constrained_window_impl.h119
1 files changed, 5 insertions, 114 deletions
diff --git a/chrome/browser/views/constrained_window_impl.h b/chrome/browser/views/constrained_window_impl.h
index 479b173..f9371fe 100644
--- a/chrome/browser/views/constrained_window_impl.h
+++ b/chrome/browser/views/constrained_window_impl.h
@@ -25,77 +25,31 @@ class WindowDelegate;
// a child HWND with a custom window frame.
//
class ConstrainedWindowImpl : public ConstrainedWindow,
- public views::CustomFrameWindow,
- public TabContentsDelegate {
+ public views::CustomFrameWindow {
public:
virtual ~ConstrainedWindowImpl();
// Returns the TabContents that constrains this Constrained Window.
TabContents* owner() const { return owner_; }
- TabContents* constrained_contents() const { return constrained_contents_; }
// Returns the non-client view inside this Constrained Window.
// NOTE: Defining the function body here would require pulling in the
// declarations of ConstrainedWindowNonClientView, as well as all the classes
// it depends on, from the .cc file; the benefit isn't worth it.
ConstrainedWindowNonClientView* non_client_view();
+ // Overridden from views::CustomFrameWindow:
+ virtual void UpdateWindowTitle();
+
// Overridden from ConstrainedWindow:
virtual void CloseConstrainedWindow();
virtual void ActivateConstrainedWindow();
- virtual void RepositionConstrainedWindowTo(const gfx::Point& anchor_point);
- virtual bool IsSuppressedConstrainedWindow() const;
+ virtual void RepositionConstrainedWindowTo(const gfx::Point& anchor_point) {}
virtual void WasHidden();
virtual void DidBecomeSelected();
virtual std::wstring GetWindowTitle() const;
- virtual void UpdateWindowTitle();
virtual const gfx::Rect& GetCurrentBounds() const;
- // Overridden from PageNavigator (TabContentsDelegate's base interface):
- virtual void OpenURLFromTab(TabContents* source,
- const GURL& url,
- const GURL& referrer,
- WindowOpenDisposition disposition,
- PageTransition::Type transition);
-
- // Overridden from TabContentsDelegate:
- virtual void NavigationStateChanged(const TabContents* source,
- unsigned changed_flags);
- virtual void ReplaceContents(TabContents* source,
- TabContents* new_contents);
- virtual void AddNewContents(TabContents* source,
- TabContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture);
- virtual void ActivateContents(TabContents* contents);
- virtual void LoadingStateChanged(TabContents* source);
- virtual void CloseContents(TabContents* source);
- virtual void MoveContents(TabContents* source, const gfx::Rect& pos);
- virtual bool IsPopup(TabContents* source);
- virtual TabContents* GetConstrainingContents(TabContents* source);
- virtual void ToolbarSizeChanged(TabContents* source, bool is_animating);
- virtual void URLStarredChanged(TabContents* source, bool) {}
- virtual void UpdateTargetURL(TabContents* source, const GURL& url) {}
- virtual bool CanBlur() const { return false; }
-
- virtual void NavigateToPage(TabContents* source, const GURL& url,
- PageTransition::Type transition);
-
-
- bool is_dialog() { return is_dialog_; }
-
- // Changes the visibility of the titlebar. |percentage| is a real
- // number ranged 0,1.
- void SetTitlebarVisibilityPercentage(double percentage);
-
- // Starts a ConstrainedWindowAnimation to slide in the titlebar of
- // this suppressed constrained popup window.
- void StartSuppressedAnimation();
-
- // Stops the ConstrainedWindowAnimation, making the entire titlebar visible.
- void StopSuppressedAnimationIfRunning();
-
protected:
// Windows message handlers:
virtual void OnDestroy();
@@ -110,78 +64,23 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
// Use the static factory methods on ConstrainedWindow to construct a
// ConstrainedWindow.
ConstrainedWindowImpl(TabContents* owner,
- views::WindowDelegate* window_delegate,
- TabContents* constrained_contents);
- ConstrainedWindowImpl(TabContents* owner,
views::WindowDelegate* window_delegate);
void Init(TabContents* owner);
- // Called after changing either the anchor point or titlebar
- // visibility of a suppressed popup.
- //
- // @see RepositionConstrainedWindowTo
- // @see SetTitlebarVisibilityPercentage
- void ResizeConstrainedTitlebar();
-
- // Called to change the size of a constrained window. Moves the
- // window to the anchor point (taking titlebar visibility into
- // account) and sets the pop up size.
- void ResizeConstrainedWindow(int width, int height);
-
// Initialize the Constrained Window as a Constrained Dialog containing a
// views::View client area.
void InitAsDialog(const gfx::Rect& initial_bounds);
- // Builds the underlying HWND and window delegates for a newly
- // created popup window.
- //
- // We have to split the initialization process for a popup window in
- // two because we first need to initialize a proper window delegate
- // 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,
- ConstrainedTabContentsWindowDelegate* delegate);
-
- // Sets the initial bounds for a newly created popup window.
- //
- // This is the second part of the initialization process started
- // with InitWindowForContents. For the parameter initial_bounds to
- // have been calculated correctly, InitWindowForContents must have
- // been run first.
- void InitSizeForContents(const gfx::Rect& initial_bounds);
-
- // Returns true if the Constrained Window can be detached from its owner.
- bool CanDetach() const;
-
- // Detach the Constrained TabContents from its owner.
- void Detach();
-
// Updates the portions of the UI as specified in |changed_flags|.
void UpdateUI(unsigned int changed_flags);
- // Place and size the window, constraining to the bounds of the |owner_|.
- void SetWindowBounds(const gfx::Rect& bounds);
-
// The TabContents that owns and constrains this ConstrainedWindow.
TabContents* owner_;
- // The TabContents constrained by |owner_|.
- TabContents* constrained_contents_;
-
// True if focus should not be restored to whatever view was focused last
// when this window is destroyed.
bool focus_restoration_disabled_;
- // A default views::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<views::WindowDelegate> contents_window_delegate_;
-
- // We keep a reference on the HWNDView so we can properly detach the tab
- // contents when detaching.
- views::HWNDView* contents_container_;
-
// true if this window is really a constrained dialog. This is set by
// InitAsDialog().
bool is_dialog_;
@@ -190,14 +89,6 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
// the constrained title bar.
gfx::Point anchor_point_;
- // The 0,1 percentage representing what amount of a titlebar of a
- // suppressed popup window should be visible. Used to animate those
- // titlebars in.
- double titlebar_visibility_;
-
- // The animation class which animates constrained windows onto the page.
- scoped_ptr<ConstrainedWindowAnimation> animation_;
-
// Current display rectangle (relative to owner_'s visible area).
gfx::Rect current_bounds_;