diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-22 18:42:29 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-22 18:42:29 +0000 |
commit | 359a5bf69945cfe2cc0fce78e851bf50f48b270b (patch) | |
tree | cfd2aab36c7e63226fff23330b39e94907238755 /chrome/browser/gtk/browser_window_gtk.h | |
parent | c57a65632f3e4cabc45f380b77d7141c7f9b0a27 (diff) | |
download | chromium_src-359a5bf69945cfe2cc0fce78e851bf50f48b270b.zip chromium_src-359a5bf69945cfe2cc0fce78e851bf50f48b270b.tar.gz chromium_src-359a5bf69945cfe2cc0fce78e851bf50f48b270b.tar.bz2 |
Add the ability to resize the window when over the custom frame.
I also switched from 3px borders to 4px borders because that's what they are
on windows. On linux, the borders look bigger because our webcontent area
doesn't drop a shadow.
For this to work for resizing on top, I had to remove the event box from
the browser titlebar and move the mouse event handling to the window.
BUG=14645
Review URL: http://codereview.chromium.org/140026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_window_gtk.h')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index 74b8dd6..b347288 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -127,6 +127,10 @@ class BrowserWindowGtk : public BrowserWindow, // close. void set_drag_active(bool drag_active) { drag_active_ = drag_active; } + // Reset the mouse cursor to the default cursor if it was set to something + // else for the custom frame. + void ResetCustomFrameCursor(); + // Returns the BrowserWindowGtk registered with |window|. static BrowserWindowGtk* GetBrowserWindowForNativeWindow( gfx::NativeWindow window); @@ -205,6 +209,14 @@ class BrowserWindowGtk : public BrowserWindow, GdkModifierType modifier, BrowserWindowGtk* browser_window); + // Mouse move and mouse button press callbacks. + static gboolean OnMouseMoveEvent(GtkWidget* widget, + GdkEventMotion* event, + BrowserWindowGtk* browser); + static gboolean OnButtonPressEvent(GtkWidget* widget, + GdkEventButton* event, + BrowserWindowGtk* browser); + // Maps and Unmaps the xid of |widget| to |window|. static void MainWindowMapped(GtkWidget* widget, BrowserWindowGtk* window); static void MainWindowUnMapped(GtkWidget* widget, BrowserWindowGtk* window); @@ -227,6 +239,11 @@ class BrowserWindowGtk : public BrowserWindow, bool IsToolbarSupported(); bool IsBookmarkBarSupported(); + // Checks to see if the mouse pointer at |x|, |y| is over the border of the + // custom frame (a spot that should trigger a window resize). Returns true if + // it should and sets |edge|. + bool GetWindowEdge(int x, int y, GdkWindowEdge* edge); + NotificationRegistrar registrar_; gfx::Rect bounds_; @@ -272,6 +289,10 @@ class BrowserWindowGtk : public BrowserWindow, // A map which translates an X Window ID into its respective GtkWindow. static std::map<XID, GtkWindow*> xid_map_; + // The current window cursor. We set it to a resize cursor when over the + // custom frame border. We set it to NULL if we want the default cursor. + GdkCursor* frame_cursor_; + DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk); }; |