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

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

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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
« no previous file with comments | « ui/views/widget/tooltip_manager_win.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('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) 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/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "ui/base/events/event.h" 10 #include "ui/base/events/event.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 467
468 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) { 468 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) {
469 gfx::Rect work_area = 469 gfx::Rect work_area =
470 gfx::Screen::GetScreenFor(GetNativeView())->GetDisplayNearestPoint( 470 gfx::Screen::GetScreenFor(GetNativeView())->GetDisplayNearestPoint(
471 bounds.origin()).work_area(); 471 bounds.origin()).work_area();
472 if (work_area.IsEmpty()) { 472 if (work_area.IsEmpty()) {
473 SetBounds(bounds); 473 SetBounds(bounds);
474 } else { 474 } else {
475 // Inset the work area slightly. 475 // Inset the work area slightly.
476 work_area.Inset(10, 10, 10, 10); 476 work_area.Inset(10, 10, 10, 10);
477 SetBounds(work_area.AdjustToFit(bounds)); 477 work_area.AdjustToFit(bounds);
478 SetBounds(work_area);
478 } 479 }
479 } 480 }
480 481
481 void Widget::SetVisibilityChangedAnimationsEnabled(bool value) { 482 void Widget::SetVisibilityChangedAnimationsEnabled(bool value) {
482 native_widget_->SetVisibilityChangedAnimationsEnabled(value); 483 native_widget_->SetVisibilityChangedAnimationsEnabled(value);
483 } 484 }
484 485
485 Widget::MoveLoopResult Widget::RunMoveLoop(const gfx::Point& drag_offset) { 486 Widget::MoveLoopResult Widget::RunMoveLoop(const gfx::Point& drag_offset) {
486 return native_widget_->RunMoveLoop(drag_offset); 487 return native_widget_->RunMoveLoop(drag_offset);
487 } 488 }
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 1354
1354 //////////////////////////////////////////////////////////////////////////////// 1355 ////////////////////////////////////////////////////////////////////////////////
1355 // internal::NativeWidgetPrivate, NativeWidget implementation: 1356 // internal::NativeWidgetPrivate, NativeWidget implementation:
1356 1357
1357 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1358 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1358 return this; 1359 return this;
1359 } 1360 }
1360 1361
1361 } // namespace internal 1362 } // namespace internal
1362 } // namespace views 1363 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/tooltip_manager_win.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698