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

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

Issue 1915363002: Rename gfx::Display/Screen to display::Display/Screen in views/wm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more cleanups Created 4 years, 8 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_aura.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/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "base/trace_event/trace_event.h" 11 #include "base/trace_event/trace_event.h"
12 #include "ui/base/cursor/cursor.h" 12 #include "ui/base/cursor/cursor.h"
13 #include "ui/base/default_style.h" 13 #include "ui/base/default_style.h"
14 #include "ui/base/default_theme_provider.h" 14 #include "ui/base/default_theme_provider.h"
15 #include "ui/base/hit_test.h" 15 #include "ui/base/hit_test.h"
16 #include "ui/base/ime/input_method.h" 16 #include "ui/base/ime/input_method.h"
17 #include "ui/base/l10n/l10n_font_util.h" 17 #include "ui/base/l10n/l10n_font_util.h"
18 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/compositor/compositor.h" 19 #include "ui/compositor/compositor.h"
20 #include "ui/compositor/layer.h" 20 #include "ui/compositor/layer.h"
21 #include "ui/display/screen.h"
21 #include "ui/events/event.h" 22 #include "ui/events/event.h"
22 #include "ui/events/event_utils.h" 23 #include "ui/events/event_utils.h"
23 #include "ui/gfx/image/image_skia.h" 24 #include "ui/gfx/image/image_skia.h"
24 #include "ui/gfx/screen.h"
25 #include "ui/views/controls/menu/menu_controller.h" 25 #include "ui/views/controls/menu/menu_controller.h"
26 #include "ui/views/event_monitor.h" 26 #include "ui/views/event_monitor.h"
27 #include "ui/views/focus/focus_manager.h" 27 #include "ui/views/focus/focus_manager.h"
28 #include "ui/views/focus/focus_manager_factory.h" 28 #include "ui/views/focus/focus_manager_factory.h"
29 #include "ui/views/focus/view_storage.h" 29 #include "ui/views/focus/view_storage.h"
30 #include "ui/views/focus/widget_focus_manager.h" 30 #include "ui/views/focus/widget_focus_manager.h"
31 #include "ui/views/views_delegate.h" 31 #include "ui/views/views_delegate.h"
32 #include "ui/views/widget/native_widget_private.h" 32 #include "ui/views/widget/native_widget_private.h"
33 #include "ui/views/widget/root_view.h" 33 #include "ui/views/widget/root_view.h"
34 #include "ui/views/widget/tooltip_manager.h" 34 #include "ui/views/widget/tooltip_manager.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 495
496 void Widget::SetSize(const gfx::Size& size) { 496 void Widget::SetSize(const gfx::Size& size) {
497 native_widget_->SetSize(size); 497 native_widget_->SetSize(size);
498 } 498 }
499 499
500 void Widget::CenterWindow(const gfx::Size& size) { 500 void Widget::CenterWindow(const gfx::Size& size) {
501 native_widget_->CenterWindow(size); 501 native_widget_->CenterWindow(size);
502 } 502 }
503 503
504 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) { 504 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) {
505 gfx::Rect work_area = gfx::Screen::GetScreen() 505 gfx::Rect work_area = display::Screen::GetScreen()
506 ->GetDisplayNearestPoint(bounds.origin()) 506 ->GetDisplayNearestPoint(bounds.origin())
507 .work_area(); 507 .work_area();
508 if (work_area.IsEmpty()) { 508 if (work_area.IsEmpty()) {
509 SetBounds(bounds); 509 SetBounds(bounds);
510 } else { 510 } else {
511 // Inset the work area slightly. 511 // Inset the work area slightly.
512 work_area.Inset(10, 10, 10, 10); 512 work_area.Inset(10, 10, 10, 10);
513 work_area.AdjustToFit(bounds); 513 work_area.AdjustToFit(bounds);
514 SetBounds(work_area); 514 SetBounds(work_area);
515 } 515 }
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 1478
1479 //////////////////////////////////////////////////////////////////////////////// 1479 ////////////////////////////////////////////////////////////////////////////////
1480 // internal::NativeWidgetPrivate, NativeWidget implementation: 1480 // internal::NativeWidgetPrivate, NativeWidget implementation:
1481 1481
1482 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1482 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1483 return this; 1483 return this;
1484 } 1484 }
1485 1485
1486 } // namespace internal 1486 } // namespace internal
1487 } // namespace views 1487 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/tooltip_manager_aura.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698