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 "ash/shelf/shelf_view.h" | 5 #include "ash/shelf/shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
11 #include "ash/ash_switches.h" | 11 #include "ash/ash_switches.h" |
12 #include "ash/aura/wm_window_aura.h" | 12 #include "ash/aura/wm_window_aura.h" |
13 #include "ash/common/shelf/shelf_constants.h" | 13 #include "ash/common/shelf/shelf_constants.h" |
14 #include "ash/common/shelf/shelf_item_delegate_manager.h" | 14 #include "ash/common/shelf/shelf_item_delegate_manager.h" |
| 15 #include "ash/common/shelf/shelf_menu_model.h" |
15 #include "ash/common/shelf/shelf_model.h" | 16 #include "ash/common/shelf/shelf_model.h" |
16 #include "ash/common/wm/root_window_finder.h" | 17 #include "ash/common/wm/root_window_finder.h" |
17 #include "ash/drag_drop/drag_image_view.h" | 18 #include "ash/drag_drop/drag_image_view.h" |
18 #include "ash/metrics/user_metrics_recorder.h" | 19 #include "ash/metrics/user_metrics_recorder.h" |
19 #include "ash/scoped_target_root_window.h" | 20 #include "ash/scoped_target_root_window.h" |
20 #include "ash/shelf/app_list_button.h" | 21 #include "ash/shelf/app_list_button.h" |
21 #include "ash/shelf/overflow_bubble.h" | 22 #include "ash/shelf/overflow_bubble.h" |
22 #include "ash/shelf/overflow_bubble_view.h" | 23 #include "ash/shelf/overflow_bubble_view.h" |
23 #include "ash/shelf/overflow_button.h" | 24 #include "ash/shelf/overflow_button.h" |
24 #include "ash/shelf/shelf.h" | 25 #include "ash/shelf/shelf.h" |
25 #include "ash/shelf/shelf_button.h" | 26 #include "ash/shelf/shelf_button.h" |
26 #include "ash/shelf/shelf_delegate.h" | 27 #include "ash/shelf/shelf_delegate.h" |
27 #include "ash/shelf/shelf_icon_observer.h" | 28 #include "ash/shelf/shelf_icon_observer.h" |
28 #include "ash/shelf/shelf_menu_model.h" | |
29 #include "ash/shelf/shelf_widget.h" | 29 #include "ash/shelf/shelf_widget.h" |
30 #include "ash/shell.h" | 30 #include "ash/shell.h" |
31 #include "ash/shell_delegate.h" | 31 #include "ash/shell_delegate.h" |
32 #include "base/auto_reset.h" | 32 #include "base/auto_reset.h" |
33 #include "base/metrics/histogram.h" | 33 #include "base/metrics/histogram.h" |
34 #include "grit/ash_strings.h" | 34 #include "grit/ash_strings.h" |
35 #include "ui/accessibility/ax_view_state.h" | 35 #include "ui/accessibility/ax_view_state.h" |
36 #include "ui/aura/client/screen_position_client.h" | 36 #include "ui/aura/client/screen_position_client.h" |
37 #include "ui/aura/window.h" | 37 #include "ui/aura/window.h" |
38 #include "ui/aura/window_event_dispatcher.h" | 38 #include "ui/aura/window_event_dispatcher.h" |
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1897 | 1897 |
1898 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { | 1898 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { |
1899 const gfx::Rect bounds = GetBoundsInScreen(); | 1899 const gfx::Rect bounds = GetBoundsInScreen(); |
1900 int distance = shelf_->SelectValueForShelfAlignment( | 1900 int distance = shelf_->SelectValueForShelfAlignment( |
1901 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), | 1901 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), |
1902 bounds.x() - coordinate.x()); | 1902 bounds.x() - coordinate.x()); |
1903 return distance > 0 ? distance : 0; | 1903 return distance > 0 ? distance : 0; |
1904 } | 1904 } |
1905 | 1905 |
1906 } // namespace ash | 1906 } // namespace ash |
OLD | NEW |