diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 05:05:48 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 05:05:48 +0000 |
commit | a3406979cd56b42ec58244e6382ca77c2c93205d (patch) | |
tree | 76d2c688df49a6d3dc3d182c86b15ffe5ba9cf8e /views/widget | |
parent | 1111563020b92fc9f6943e0b5c00f66de2f57082 (diff) | |
download | chromium_src-a3406979cd56b42ec58244e6382ca77c2c93205d.zip chromium_src-a3406979cd56b42ec58244e6382ca77c2c93205d.tar.gz chromium_src-a3406979cd56b42ec58244e6382ca77c2c93205d.tar.bz2 |
Attempt 2 at:
Gets find bar animation/clipping to work on views/gtk.
The only difference between this and the first version is fixing an
include in extension_host that was triggering mac to build views, as
well as an extraneous SetSlideDuration I had used for testing.
BUG=none
TEST=none
TBR=ben
Review URL: http://codereview.chromium.org/342116
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/widget.h | 4 | ||||
-rw-r--r-- | views/widget/widget_gtk.cc | 4 | ||||
-rw-r--r-- | views/widget/widget_gtk.h | 2 | ||||
-rw-r--r-- | views/widget/widget_win.cc | 4 | ||||
-rw-r--r-- | views/widget/widget_win.h | 2 |
5 files changed, 7 insertions, 9 deletions
diff --git a/views/widget/widget.h b/views/widget/widget.h index 7b08737..357f07a 100644 --- a/views/widget/widget.h +++ b/views/widget/widget.h @@ -96,8 +96,8 @@ class Widget { // Places the widget in front of the specified widget in z-order. virtual void MoveAbove(Widget* widget) = 0; - // Sets a shape on the widget. - virtual void SetShape(const gfx::Path& shape) = 0; + // Sets a shape on the widget. This takes ownership of shape. + virtual void SetShape(gfx::NativeRegion shape) = 0; // Hides the widget then closes it after a return to the message loop. virtual void Close() = 0; diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 4557286..4edef7c 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -378,12 +378,10 @@ void WidgetGtk::MoveAbove(Widget* widget) { NOTIMPLEMENTED(); } -void WidgetGtk::SetShape(const gfx::Path& shape) { +void WidgetGtk::SetShape(gfx::NativeRegion region) { DCHECK(widget_); DCHECK(widget_->window); - gdk_window_shape_combine_region(widget_->window, NULL, 0, 0); - GdkRegion* region = shape.CreateGdkRegion(); gdk_window_shape_combine_region(widget_->window, region, 0, 0); gdk_region_destroy(region); } diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h index e97f58e..3799a4a 100644 --- a/views/widget/widget_gtk.h +++ b/views/widget/widget_gtk.h @@ -118,7 +118,7 @@ class WidgetGtk virtual void GetBounds(gfx::Rect* out, bool including_frame) const; virtual void SetBounds(const gfx::Rect& bounds); virtual void MoveAbove(Widget* other); - virtual void SetShape(const gfx::Path& shape); + virtual void SetShape(gfx::NativeRegion region); virtual void Close(); virtual void CloseNow(); virtual void Show(); diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index e0edee8..a3dc3ce 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -144,8 +144,8 @@ void WidgetWin::MoveAbove(Widget* other) { bounds.width(), bounds.height(), SWP_NOACTIVATE); } -void WidgetWin::SetShape(const gfx::Path& shape) { - SetWindowRgn(shape.CreateHRGN(), TRUE); +void WidgetWin::SetShape(gfx::NativeRegion region) { + SetWindowRgn(region, TRUE); } void WidgetWin::Close() { diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h index b8e21dd..f22417c 100644 --- a/views/widget/widget_win.h +++ b/views/widget/widget_win.h @@ -184,7 +184,7 @@ class WidgetWin : public app::WindowImpl, virtual void GetBounds(gfx::Rect* out, bool including_frame) const; virtual void SetBounds(const gfx::Rect& bounds); virtual void MoveAbove(Widget* other); - virtual void SetShape(const gfx::Path& shape); + virtual void SetShape(gfx::NativeRegion region); virtual void Close(); virtual void CloseNow(); virtual void Show(); |