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/app_list/views/apps_grid_view.h" | 5 #include "ui/app_list/views/apps_grid_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 #endif // defined(USE_AURA) | 39 #endif // defined(USE_AURA) |
40 | 40 |
41 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
42 #include "base/command_line.h" | 42 #include "base/command_line.h" |
43 #include "base/files/file_path.h" | 43 #include "base/files/file_path.h" |
44 #include "base/win/shortcut.h" | 44 #include "base/win/shortcut.h" |
45 #include "ui/base/dragdrop/drag_utils.h" | 45 #include "ui/base/dragdrop/drag_utils.h" |
46 #include "ui/base/dragdrop/drop_target_win.h" | 46 #include "ui/base/dragdrop/drop_target_win.h" |
47 #include "ui/base/dragdrop/os_exchange_data.h" | 47 #include "ui/base/dragdrop/os_exchange_data.h" |
48 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" | 48 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
49 #include "ui/gfx/win/dpi.h" | 49 #include "ui/gfx/screen_win.h" |
50 #endif | 50 #endif |
51 | 51 |
52 namespace app_list { | 52 namespace app_list { |
53 | 53 |
54 namespace { | 54 namespace { |
55 | 55 |
56 // Distance a drag needs to be from the app grid to be considered 'outside', at | 56 // Distance a drag needs to be from the app grid to be considered 'outside', at |
57 // which point we rearrange the apps to their pre-drag configuration, as a drop | 57 // which point we rearrange the apps to their pre-drag configuration, as a drop |
58 // then would be canceled. We have a buffer to make it easier to drag apps to | 58 // then would be canceled. We have a buffer to make it easier to drag apps to |
59 // other pages. | 59 // other pages. |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 POINT p; | 329 POINT p; |
330 GetCursorPos(&p); | 330 GetCursorPos(&p); |
331 return GetGridViewHWND() == WindowFromPoint(p); | 331 return GetGridViewHWND() == WindowFromPoint(p); |
332 } | 332 } |
333 | 333 |
334 gfx::Point GetCursorInGridViewCoords() { | 334 gfx::Point GetCursorInGridViewCoords() { |
335 POINT p; | 335 POINT p; |
336 GetCursorPos(&p); | 336 GetCursorPos(&p); |
337 ScreenToClient(GetGridViewHWND(), &p); | 337 ScreenToClient(GetGridViewHWND(), &p); |
338 gfx::Point grid_view_pt(p.x, p.y); | 338 gfx::Point grid_view_pt(p.x, p.y); |
339 grid_view_pt = gfx::win::ScreenToDIPPoint(grid_view_pt); | 339 grid_view_pt = |
| 340 gfx::ScreenWin::ClientToDIPPoint(GetGridViewHWND(), grid_view_pt); |
340 views::View::ConvertPointFromWidget(grid_view_, &grid_view_pt); | 341 views::View::ConvertPointFromWidget(grid_view_, &grid_view_pt); |
341 return grid_view_pt; | 342 return grid_view_pt; |
342 } | 343 } |
343 | 344 |
344 AppsGridView* grid_view_; | 345 AppsGridView* grid_view_; |
345 AppListItemView* drag_view_; | 346 AppListItemView* drag_view_; |
346 gfx::Point drag_view_offset_; | 347 gfx::Point drag_view_offset_; |
347 bool has_shortcut_path_; | 348 bool has_shortcut_path_; |
348 base::FilePath shortcut_path_; | 349 base::FilePath shortcut_path_; |
349 bool running_; | 350 bool running_; |
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2182 | 2183 |
2183 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, | 2184 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, |
2184 bool is_target_folder) { | 2185 bool is_target_folder) { |
2185 AppListItemView* target_view = | 2186 AppListItemView* target_view = |
2186 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot); | 2187 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot); |
2187 if (target_view) | 2188 if (target_view) |
2188 target_view->SetAsAttemptedFolderTarget(is_target_folder); | 2189 target_view->SetAsAttemptedFolderTarget(is_target_folder); |
2189 } | 2190 } |
2190 | 2191 |
2191 } // namespace app_list | 2192 } // namespace app_list |
OLD | NEW |