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

Unified Diff: ui/views/controls/menu/menu_controller.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/scrollbar/base_scroll_bar_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 86be859dcc47ad7c7ef9bbda0341291480dc4586..221e55ec98c56dd911f83531a6312bb96dcb6817 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -889,7 +889,7 @@ ui::PostDispatchAction MenuController::OnWillDispatchKeyEvent(
void MenuController::UpdateSubmenuSelection(SubmenuView* submenu) {
if (submenu->IsShowing()) {
- gfx::Point point = GetScreen()->GetCursorScreenPoint();
+ gfx::Point point = gfx::Screen::GetScreen()->GetCursorScreenPoint();
const SubmenuView* root_submenu =
submenu->GetMenuItem()->GetRootMenuItem()->GetSubmenu();
View::ConvertPointFromScreen(
@@ -1235,14 +1235,16 @@ void MenuController::UpdateInitialLocation(const gfx::Rect& bounds,
// Calculate the bounds of the monitor we'll show menus on. Do this once to
// avoid repeated system queries for the info.
- pending_state_.monitor_bounds = GetScreen()->GetDisplayNearestPoint(
- bounds.origin()).work_area();
+ pending_state_.monitor_bounds = gfx::Screen::GetScreen()
+ ->GetDisplayNearestPoint(bounds.origin())
+ .work_area();
if (!pending_state_.monitor_bounds.Contains(bounds)) {
// Use the monitor area if the work area doesn't contain the bounds. This
// handles showing a menu from the launcher.
- gfx::Rect monitor_area = GetScreen()->GetDisplayNearestPoint(
- bounds.origin()).bounds();
+ gfx::Rect monitor_area = gfx::Screen::GetScreen()
+ ->GetDisplayNearestPoint(bounds.origin())
+ .bounds();
if (monitor_area.Contains(bounds))
pending_state_.monitor_bounds = monitor_area;
}
@@ -1275,7 +1277,8 @@ bool MenuController::ShowSiblingMenu(SubmenuView* source,
return false;
}
- gfx::NativeWindow window_under_mouse = GetScreen()->GetWindowUnderCursor();
+ gfx::NativeWindow window_under_mouse =
+ gfx::Screen::GetScreen()->GetWindowUnderCursor();
// TODO(oshima): Replace with views only API.
if (!owner_ || window_under_mouse != owner_->GetNativeWindow())
return false;
@@ -2274,7 +2277,7 @@ void MenuController::RepostEventAndCancel(SubmenuView* source,
gfx::NativeView native_view = source->GetWidget()->GetNativeView();
gfx::NativeWindow window = nullptr;
if (native_view) {
- gfx::Screen* screen = gfx::Screen::GetScreenFor(native_view);
+ gfx::Screen* screen = gfx::Screen::GetScreen();
window = screen->GetWindowAtScreenPoint(screen_loc);
}
#endif
@@ -2571,10 +2574,4 @@ void MenuController::HandleMouseLocation(SubmenuView* source,
}
}
-gfx::Screen* MenuController::GetScreen() {
- Widget* root = owner_ ? owner_->GetTopLevelWidget() : NULL;
- return root ? gfx::Screen::GetScreenFor(root->GetNativeView())
- : gfx::Screen::GetNativeScreen();
-}
-
} // namespace views
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/scrollbar/base_scroll_bar_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698