Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views.cc

Issue 456943004: Fix SetShape (SetAlphaShape) to allow Null regions (+ tests). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/apps/chrome_native_app_window_views.cc
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc
index 3aecc9d01fdcf2f6a18b1cd4f2abaeca1a74a045..ed01f1127493ebd046daad67459dd2099c9ad8c1 100644
--- a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc
+++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc
@@ -661,12 +661,15 @@ void ChromeNativeAppWindowViews::UpdateShape(scoped_ptr<SkRegion> region) {
aura::Window* native_window = widget()->GetNativeWindow();
if (shape_) {
widget()->SetShape(new SkRegion(*shape_));
+ native_window->layer()->SetAlphaShape(
sky 2014/08/11 15:26:37 Why don't we implement this in the NativeWidget im
garykac 2014/08/11 18:19:09 I'm not sure - the original implementation was don
Zachary Kuznia 2014/08/11 20:05:14 The SetShape() function didn't exist on widget whe
+ make_scoped_ptr(new SkRegion(*shape_)));
if (!had_shape) {
native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>(
new ShapedAppWindowTargeter(native_window, this)));
}
} else {
widget()->SetShape(NULL);
+ native_window->layer()->SetAlphaShape(scoped_ptr<SkRegion>());
if (had_shape)
native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>());
}

Powered by Google App Engine
This is Rietveld 408576698