| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/app_list/win/app_list_win.h" | 5 #include "chrome/browser/ui/views/app_list/win/app_list_win.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/app_list/app_list_positioner.h" | 7 #include "chrome/browser/ui/app_list/app_list_positioner.h" |
| 8 #include "ui/app_list/app_list_switches.h" | 8 #include "ui/app_list/app_list_switches.h" |
| 9 #include "ui/app_list/views/app_list_view.h" | 9 #include "ui/app_list/views/app_list_view.h" |
| 10 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 if (positioner.GetCursorDistanceFromShelf(edge, cursor) > kSnapDistance) | 74 if (positioner.GetCursorDistanceFromShelf(edge, cursor) > kSnapDistance) |
| 75 return positioner.GetAnchorPointForShelfCorner(edge); | 75 return positioner.GetAnchorPointForShelfCorner(edge); |
| 76 | 76 |
| 77 return positioner.GetAnchorPointForShelfCursor(edge, cursor); | 77 return positioner.GetAnchorPointForShelfCursor(edge, cursor); |
| 78 } | 78 } |
| 79 | 79 |
| 80 // static | 80 // static |
| 81 void AppListWin::MoveNearCursor(app_list::AppListView* view) { | 81 void AppListWin::MoveNearCursor(app_list::AppListView* view) { |
| 82 gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); | 82 gfx::Screen* screen = gfx::Screen::GetScreen(); |
| 83 gfx::Screen* screen = | 83 gfx::Point cursor = screen->GetCursorScreenPoint(); |
| 84 gfx::Screen::GetScreenFor(view->GetWidget()->GetNativeView()); | |
| 85 gfx::Display display = screen->GetDisplayNearestPoint(cursor); | 84 gfx::Display display = screen->GetDisplayNearestPoint(cursor); |
| 86 | 85 |
| 87 view->SetBubbleArrow(views::BubbleBorder::FLOAT); | 86 view->SetBubbleArrow(views::BubbleBorder::FLOAT); |
| 88 gfx::Rect taskbar_rect; | 87 gfx::Rect taskbar_rect; |
| 89 GetTaskbarRect(&taskbar_rect); | 88 GetTaskbarRect(&taskbar_rect); |
| 90 view->SetAnchorPoint(FindAnchorPoint(view->GetPreferredSize(), | 89 view->SetAnchorPoint(FindAnchorPoint(view->GetPreferredSize(), |
| 91 display, | 90 display, |
| 92 cursor, | 91 cursor, |
| 93 taskbar_rect, | 92 taskbar_rect, |
| 94 view->ShouldCenterWindow())); | 93 view->ShouldCenterWindow())); |
| 95 } | 94 } |
| OLD | NEW |