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

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: 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
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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // No need for this. Just delete and ignore.
442 delete region; 442 if (region)
sky 2014/08/11 15:26:37 no need for the if.
garykac 2014/08/11 18:19:09 Done.
443 delete region;
443 } 444 }
444 445
445 void NativeWidgetAura::Close() { 446 void NativeWidgetAura::Close() {
446 // |window_| may already be deleted by parent window. This can happen 447 // |window_| may already be deleted by parent window. This can happen
447 // when this widget is child widget or has transient parent 448 // when this widget is child widget or has transient parent
448 // and ownership is WIDGET_OWNS_NATIVE_WIDGET. 449 // and ownership is WIDGET_OWNS_NATIVE_WIDGET.
449 DCHECK(window_ || 450 DCHECK(window_ ||
450 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); 451 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET);
451 if (window_) { 452 if (window_) {
452 window_->SuppressPaint(); 453 window_->SuppressPaint();
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); 1153 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont));
1153 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); 1154 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
1154 return gfx::FontList(gfx::Font(caption_font)); 1155 return gfx::FontList(gfx::Font(caption_font));
1155 #else 1156 #else
1156 return gfx::FontList(); 1157 return gfx::FontList();
1157 #endif 1158 #endif
1158 } 1159 }
1159 1160
1160 } // namespace internal 1161 } // namespace internal
1161 } // namespace views 1162 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698