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/hit_test.h" | 10 #include "ui/base/hit_test.h" |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 void Widget::SetSize(const gfx::Size& size) { | 435 void Widget::SetSize(const gfx::Size& size) { |
436 native_widget_->SetSize(size); | 436 native_widget_->SetSize(size); |
437 } | 437 } |
438 | 438 |
439 void Widget::CenterWindow(const gfx::Size& size) { | 439 void Widget::CenterWindow(const gfx::Size& size) { |
440 native_widget_->CenterWindow(size); | 440 native_widget_->CenterWindow(size); |
441 } | 441 } |
442 | 442 |
443 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) { | 443 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) { |
444 gfx::Rect work_area = | 444 gfx::Rect work_area = |
445 gfx::Screen::GetMonitorNearestPoint(bounds.origin()).work_area(); | 445 gfx::Screen::GetDisplayNearestPoint(bounds.origin()).work_area(); |
446 if (work_area.IsEmpty()) { | 446 if (work_area.IsEmpty()) { |
447 SetBounds(bounds); | 447 SetBounds(bounds); |
448 } else { | 448 } else { |
449 // Inset the work area slightly. | 449 // Inset the work area slightly. |
450 work_area.Inset(10, 10, 10, 10); | 450 work_area.Inset(10, 10, 10, 10); |
451 SetBounds(work_area.AdjustToFit(bounds)); | 451 SetBounds(work_area.AdjustToFit(bounds)); |
452 } | 452 } |
453 } | 453 } |
454 | 454 |
455 void Widget::SetVisibilityChangedAnimationsEnabled(bool value) { | 455 void Widget::SetVisibilityChangedAnimationsEnabled(bool value) { |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 | 1334 |
1335 //////////////////////////////////////////////////////////////////////////////// | 1335 //////////////////////////////////////////////////////////////////////////////// |
1336 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1336 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1337 | 1337 |
1338 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1338 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1339 return this; | 1339 return this; |
1340 } | 1340 } |
1341 | 1341 |
1342 } // namespace internal | 1342 } // namespace internal |
1343 } // namespace views | 1343 } // namespace views |
OLD | NEW |