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

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

Issue 258833002: Add dcheck to make sure the maximizable window does not have maximum size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | 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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 } 689 }
690 690
691 //////////////////////////////////////////////////////////////////////////////// 691 ////////////////////////////////////////////////////////////////////////////////
692 // NativeWidgetAura, aura::WindowDelegate implementation: 692 // NativeWidgetAura, aura::WindowDelegate implementation:
693 693
694 gfx::Size NativeWidgetAura::GetMinimumSize() const { 694 gfx::Size NativeWidgetAura::GetMinimumSize() const {
695 return delegate_->GetMinimumSize(); 695 return delegate_->GetMinimumSize();
696 } 696 }
697 697
698 gfx::Size NativeWidgetAura::GetMaximumSize() const { 698 gfx::Size NativeWidgetAura::GetMaximumSize() const {
699 // If a window have a maximum size, the window should not be
700 // maximizable.
701 DCHECK(delegate_->GetMaximumSize().IsEmpty() ||
702 !window_->GetProperty(aura::client::kCanMaximizeKey));
699 return delegate_->GetMaximumSize(); 703 return delegate_->GetMaximumSize();
700 } 704 }
701 705
702 void NativeWidgetAura::OnBoundsChanged(const gfx::Rect& old_bounds, 706 void NativeWidgetAura::OnBoundsChanged(const gfx::Rect& old_bounds,
703 const gfx::Rect& new_bounds) { 707 const gfx::Rect& new_bounds) {
704 // Assume that if the old bounds was completely empty a move happened. This 708 // Assume that if the old bounds was completely empty a move happened. This
705 // handles the case of a maximize animation acquiring the layer (acquiring a 709 // handles the case of a maximize animation acquiring the layer (acquiring a
706 // layer results in clearing the bounds). 710 // layer results in clearing the bounds).
707 if (old_bounds.origin() != new_bounds.origin() || 711 if (old_bounds.origin() != new_bounds.origin() ||
708 (old_bounds == gfx::Rect(0, 0, 0, 0) && !new_bounds.IsEmpty())) { 712 (old_bounds == gfx::Rect(0, 0, 0, 0) && !new_bounds.IsEmpty())) {
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); 1138 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont));
1135 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); 1139 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
1136 return gfx::FontList(gfx::Font(caption_font)); 1140 return gfx::FontList(gfx::Font(caption_font));
1137 #else 1141 #else
1138 return gfx::FontList(); 1142 return gfx::FontList();
1139 #endif 1143 #endif
1140 } 1144 }
1141 1145
1142 } // namespace internal 1146 } // namespace internal
1143 } // namespace views 1147 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698