diff options
author | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-09 20:10:17 +0000 |
---|---|---|
committer | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-09 20:10:17 +0000 |
commit | c3826037cbcb22fe784a10589061eaf084818727 (patch) | |
tree | 58da3c893c97e0fd5fee5df93f3dc30db7b93a40 /chrome/browser/tab_contents/tab_contents_delegate.h | |
parent | b595ba77947ee0881ae8ce16ee92b47d1c48f10a (diff) | |
download | chromium_src-c3826037cbcb22fe784a10589061eaf084818727.zip chromium_src-c3826037cbcb22fe784a10589061eaf084818727.tar.gz chromium_src-c3826037cbcb22fe784a10589061eaf084818727.tar.bz2 |
Add a new resizer corner.
To display a resize bitmap and handle the mouse interactions as requested in
http://code.google.com/p/chromium/issues/detail?id=458.
BUG=458
There are unfortunately two cases to handle and they must be handled separately.
The first one is when there are no bottom shelf like the download bar,
and the case where there is one.
For the case without, we must draw on top of what we receive from WebKit,
so we intercept the bitmap in RenderWidgetHostViewWin::OnPaint() so that we
can draw the resize corner bitmap on top of it (taking into account whether
we are in a right to left language or not).
For the case where we have a bottom shelf, we use a dedicated view that we
properly layout on top of the bottom shelf view (which takes care of handling
the RTL language case for us).
Same split for the mouse interactions. Without the bottom shelf, we must deal
with it in RenderWidgetHostViewWin::OnMouseEvent() by sending the root window
a WM_NCLBUTTONDOWN message with either HTBOTTOMRIGHT or HTBOTTOMLEFT (based on
the RTL setting) and let the OS take care of the resizing. IF we have a bottom
shelf, we must deal with the mouse interaction in
BrowserView::NonClientHitTest()
to either return HTBOTTOMRIGHT or HTBOTTOMLEFT (again, based on the RTL setting)
and, again, let the OS take care of the resizing.
More details here:
http://code.google.com/p/chromium/wiki/BrowserViewResizer
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/tab_contents_delegate.h')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_delegate.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h index 428f98e..05f5e79 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -6,14 +6,10 @@ #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ #include "base/basictypes.h" +#include "base/gfx/rect.h" #include "chrome/browser/tab_contents/page_navigator.h" #include "chrome/common/navigation_types.h" -namespace gfx { -class Point; -class Rect; -} - class TabContents; class HtmlDialogContentsDelegate; @@ -30,8 +26,7 @@ class TabContentsDelegate : public PageNavigator { virtual void OpenURL(const GURL& url, const GURL& referrer, WindowOpenDisposition disposition, - PageTransition::Type transition) - { + PageTransition::Type transition) { OpenURLFromTab(NULL, url, referrer, disposition, transition); } @@ -106,7 +101,7 @@ class TabContentsDelegate : public PageNavigator { // a WebContents with a valid WebApp set. virtual void ConvertContentsToApplication(TabContents* source) { } - // Informs the TabContentsDelegate that some of our state has changed + // Informs the TabContentsDelegate that some of our state has changed // for this tab. virtual void ContentsStateChanged(TabContents* source) {} @@ -119,6 +114,10 @@ class TabContentsDelegate : public PageNavigator { // call. ConstrainedWindows shouldn't be able to be blurred. virtual bool CanBlur() const { return true; } + // Return the rect where to display the resize corner, if any, otherwise + // an empty rect. + virtual gfx::Rect GetRootWindowResizerRect() const { return gfx::Rect(); } + // Show a dialog with HTML content. |delegate| contains a pointer to the // delegate who knows how to display the dialog (which file URL and JSON // string input to use during initialization). |parent_window| is the window @@ -129,17 +128,17 @@ class TabContentsDelegate : public PageNavigator { // Tells us that we've finished firing this tab's beforeunload event. // The proceed bool tells us whether the user chose to proceed closing the // tab. Returns true if the tab can continue on firing it's unload event. - // If we're closing the entire browser, then we'll want to delay firing + // If we're closing the entire browser, then we'll want to delay firing // unload events until all the beforeunload events have fired. virtual void BeforeUnloadFired(TabContents* tab, - bool proceed, - bool* proceed_to_fire_unload) { + bool proceed, + bool* proceed_to_fire_unload) { *proceed_to_fire_unload = true; } // Send IPC to external host. Default implementation is do nothing. virtual void ForwardMessageToExternalHost(const std::string& receiver, - const std::string& message) {}; + const std::string& message) {} // If the delegate is hosting tabs externally. virtual bool IsExternalTabContainer() const { return false; } |