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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 void Widget::SetSize(const gfx::Size& size) { | 417 void Widget::SetSize(const gfx::Size& size) { |
418 native_widget_->SetSize(size); | 418 native_widget_->SetSize(size); |
419 } | 419 } |
420 | 420 |
421 void Widget::CenterWindow(const gfx::Size& size) { | 421 void Widget::CenterWindow(const gfx::Size& size) { |
422 native_widget_->CenterWindow(size); | 422 native_widget_->CenterWindow(size); |
423 } | 423 } |
424 | 424 |
425 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) { | 425 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) { |
426 gfx::Rect work_area = | 426 gfx::Rect work_area = |
427 gfx::Screen::GetMonitorWorkAreaNearestPoint(bounds.origin()); | 427 gfx::Screen::GetMonitorNearestPoint(bounds.origin()).work_area(); |
428 if (work_area.IsEmpty()) { | 428 if (work_area.IsEmpty()) { |
429 SetBounds(bounds); | 429 SetBounds(bounds); |
430 } else { | 430 } else { |
431 // Inset the work area slightly. | 431 // Inset the work area slightly. |
432 work_area.Inset(10, 10, 10, 10); | 432 work_area.Inset(10, 10, 10, 10); |
433 SetBounds(work_area.AdjustToFit(bounds)); | 433 SetBounds(work_area.AdjustToFit(bounds)); |
434 } | 434 } |
435 } | 435 } |
436 | 436 |
437 void Widget::SetVisibilityChangedAnimationsEnabled(bool value) { | 437 void Widget::SetVisibilityChangedAnimationsEnabled(bool value) { |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 | 1260 |
1261 //////////////////////////////////////////////////////////////////////////////// | 1261 //////////////////////////////////////////////////////////////////////////////// |
1262 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1262 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1263 | 1263 |
1264 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1264 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1265 return this; | 1265 return this; |
1266 } | 1266 } |
1267 | 1267 |
1268 } // namespace internal | 1268 } // namespace internal |
1269 } // namespace views | 1269 } // namespace views |
OLD | NEW |