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