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

Side by Side Diff: ui/aura/window.cc

Issue 8618009: Aura: Fix window resizing for large drags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix HtmlDialogBrowserTest Created 9 years 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/aura/test/test_window_delegate.cc ('k') | ui/aura/window_delegate.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 Desktop* Window::GetDesktop() { 433 Desktop* Window::GetDesktop() {
434 return parent_ ? parent_->GetDesktop() : NULL; 434 return parent_ ? parent_->GetDesktop() : NULL;
435 } 435 }
436 436
437 void Window::WindowDetachedFromDesktop(aura::Window* window) { 437 void Window::WindowDetachedFromDesktop(aura::Window* window) {
438 } 438 }
439 439
440 void Window::SetBoundsInternal(const gfx::Rect& new_bounds) { 440 void Window::SetBoundsInternal(const gfx::Rect& new_bounds) {
441 gfx::Rect actual_new_bounds(new_bounds); 441 gfx::Rect actual_new_bounds(new_bounds);
442 442
443 // Gives delegate a change to examine and change the new bounds. 443 // Ensure we don't go smaller than our minimum bounds.
444 if (delegate_) 444 if (delegate_) {
445 delegate_->OnBoundsChanging(&actual_new_bounds); 445 const gfx::Size& min_size = delegate_->GetMinimumSize();
446 actual_new_bounds.set_width(
447 std::max(min_size.width(), actual_new_bounds.width()));
448 actual_new_bounds.set_height(
449 std::max(min_size.height(), actual_new_bounds.height()));
450 }
446 451
447 const gfx::Rect old_bounds = layer_->GetTargetBounds(); 452 const gfx::Rect old_bounds = layer_->GetTargetBounds();
448 453
449 // Always need to set the layer's bounds -- even if it is to the same thing. 454 // Always need to set the layer's bounds -- even if it is to the same thing.
450 // This may cause important side effects such as stopping animation. 455 // This may cause important side effects such as stopping animation.
451 layer_->SetBounds(actual_new_bounds); 456 layer_->SetBounds(actual_new_bounds);
452 457
453 // If we're not changing the effective bounds, then we can bail early and skip 458 // If we're not changing the effective bounds, then we can bail early and skip
454 // notifying our listeners. 459 // notifying our listeners.
455 if (old_bounds == actual_new_bounds) 460 if (old_bounds == actual_new_bounds)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 void Window::OnStackingChanged() { 538 void Window::OnStackingChanged() {
534 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowStackingChanged(this)); 539 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowStackingChanged(this));
535 } 540 }
536 541
537 void Window::OnPaintLayer(gfx::Canvas* canvas) { 542 void Window::OnPaintLayer(gfx::Canvas* canvas) {
538 if (delegate_) 543 if (delegate_)
539 delegate_->OnPaint(canvas); 544 delegate_->OnPaint(canvas);
540 } 545 }
541 546
542 } // namespace aura 547 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/test_window_delegate.cc ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698