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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 456943004: Fix SetShape (SetAlphaShape) to allow Null regions (+ tests). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move SetAlphaShape into native_widget's SetShape 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/aura/client/aura_constants.h" 10 #include "ui/aura/client/aura_constants.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 window_->parent()->StackChildAtTop(window_); 431 window_->parent()->StackChildAtTop(window_);
432 } 432 }
433 433
434 void NativeWidgetAura::StackBelow(gfx::NativeView native_view) { 434 void NativeWidgetAura::StackBelow(gfx::NativeView native_view) {
435 if (window_ && window_->parent() && 435 if (window_ && window_->parent() &&
436 window_->parent() == native_view->parent()) 436 window_->parent() == native_view->parent())
437 window_->parent()->StackChildBelow(window_, native_view); 437 window_->parent()->StackChildBelow(window_, native_view);
438 } 438 }
439 439
440 void NativeWidgetAura::SetShape(gfx::NativeRegion region) { 440 void NativeWidgetAura::SetShape(gfx::NativeRegion region) {
441 // No need for this. Just delete and ignore. 441 if (window_ && window_->layer())
sky 2014/08/11 23:06:18 no need for the window_->layer() part of the condi
garykac 2014/08/11 23:20:56 Done.
442 delete region; 442 window_->layer()->SetAlphaShape(make_scoped_ptr(region));
sky 2014/08/11 23:06:18 else case to delete region?
garykac 2014/08/11 23:20:56 Done.
443 } 443 }
444 444
445 void NativeWidgetAura::Close() { 445 void NativeWidgetAura::Close() {
446 // |window_| may already be deleted by parent window. This can happen 446 // |window_| may already be deleted by parent window. This can happen
447 // when this widget is child widget or has transient parent 447 // when this widget is child widget or has transient parent
448 // and ownership is WIDGET_OWNS_NATIVE_WIDGET. 448 // and ownership is WIDGET_OWNS_NATIVE_WIDGET.
449 DCHECK(window_ || 449 DCHECK(window_ ||
450 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); 450 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET);
451 if (window_) { 451 if (window_) {
452 window_->SuppressPaint(); 452 window_->SuppressPaint();
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); 1152 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont));
1153 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); 1153 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
1154 return gfx::FontList(gfx::Font(caption_font)); 1154 return gfx::FontList(gfx::Font(caption_font));
1155 #else 1155 #else
1156 return gfx::FontList(); 1156 return gfx::FontList();
1157 #endif 1157 #endif
1158 } 1158 }
1159 1159
1160 } // namespace internal 1160 } // namespace internal
1161 } // namespace views 1161 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698