OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |