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 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
11 #include "ash/drag_drop/drag_image_view.h" | 11 #include "ash/drag_drop/drag_image_view.h" |
12 #include "ash/metrics/user_metrics_recorder.h" | 12 #include "ash/metrics/user_metrics_recorder.h" |
13 #include "ash/root_window_controller.h" | 13 #include "ash/root_window_controller.h" |
14 #include "ash/scoped_target_root_window.h" | 14 #include "ash/scoped_target_root_window.h" |
15 #include "ash/shelf/alternate_app_list_button.h" | 15 #include "ash/shelf/alternate_app_list_button.h" |
16 #include "ash/shelf/app_list_button.h" | 16 #include "ash/shelf/app_list_button.h" |
17 #include "ash/shelf/overflow_bubble.h" | 17 #include "ash/shelf/overflow_bubble.h" |
18 #include "ash/shelf/overflow_bubble_view.h" | 18 #include "ash/shelf/overflow_bubble_view.h" |
19 #include "ash/shelf/overflow_button.h" | 19 #include "ash/shelf/overflow_button.h" |
20 #include "ash/shelf/shelf_button.h" | 20 #include "ash/shelf/shelf_button.h" |
| 21 #include "ash/shelf/shelf_constants.h" |
21 #include "ash/shelf/shelf_delegate.h" | 22 #include "ash/shelf/shelf_delegate.h" |
22 #include "ash/shelf/shelf_icon_observer.h" | 23 #include "ash/shelf/shelf_icon_observer.h" |
23 #include "ash/shelf/shelf_item_delegate.h" | 24 #include "ash/shelf/shelf_item_delegate.h" |
24 #include "ash/shelf/shelf_item_delegate_manager.h" | 25 #include "ash/shelf/shelf_item_delegate_manager.h" |
25 #include "ash/shelf/shelf_layout_manager.h" | 26 #include "ash/shelf/shelf_layout_manager.h" |
26 #include "ash/shelf/shelf_menu_model.h" | 27 #include "ash/shelf/shelf_menu_model.h" |
27 #include "ash/shelf/shelf_model.h" | 28 #include "ash/shelf/shelf_model.h" |
28 #include "ash/shelf/shelf_tooltip_manager.h" | 29 #include "ash/shelf/shelf_tooltip_manager.h" |
29 #include "ash/shelf/shelf_widget.h" | 30 #include "ash/shelf/shelf_widget.h" |
30 #include "ash/shell.h" | 31 #include "ash/shell.h" |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 const int last_overflow_index = last_hidden_index_; | 1342 const int last_overflow_index = last_hidden_index_; |
1342 DCHECK_LE(first_overflow_index, last_overflow_index); | 1343 DCHECK_LE(first_overflow_index, last_overflow_index); |
1343 DCHECK_LT(last_overflow_index, view_model_->view_size()); | 1344 DCHECK_LT(last_overflow_index, view_model_->view_size()); |
1344 | 1345 |
1345 overflow_view->first_visible_index_ = first_overflow_index; | 1346 overflow_view->first_visible_index_ = first_overflow_index; |
1346 overflow_view->last_visible_index_ = last_overflow_index; | 1347 overflow_view->last_visible_index_ = last_overflow_index; |
1347 } | 1348 } |
1348 | 1349 |
1349 int ShelfView::GetButtonSize() const { | 1350 int ShelfView::GetButtonSize() const { |
1350 return ash::switches::UseAlternateShelfLayout() ? | 1351 return ash::switches::UseAlternateShelfLayout() ? |
1351 kButtonSize : kLauncherPreferredSize; | 1352 kButtonSize : kShelfPreferredSize; |
1352 } | 1353 } |
1353 | 1354 |
1354 int ShelfView::GetButtonSpacing() const { | 1355 int ShelfView::GetButtonSpacing() const { |
1355 return ash::switches::UseAlternateShelfLayout() ? | 1356 return ash::switches::UseAlternateShelfLayout() ? |
1356 kAlternateButtonSpacing : kButtonSpacing; | 1357 kAlternateButtonSpacing : kButtonSpacing; |
1357 } | 1358 } |
1358 | 1359 |
1359 bool ShelfView::ShouldHideTooltip(const gfx::Point& cursor_location) { | 1360 bool ShelfView::ShouldHideTooltip(const gfx::Point& cursor_location) { |
1360 gfx::Rect active_bounds; | 1361 gfx::Rect active_bounds; |
1361 | 1362 |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2017 break; | 2018 break; |
2018 case ash::SHELF_ALIGNMENT_TOP: | 2019 case ash::SHELF_ALIGNMENT_TOP: |
2019 distance = coordinate.y() - bounds.bottom(); | 2020 distance = coordinate.y() - bounds.bottom(); |
2020 break; | 2021 break; |
2021 } | 2022 } |
2022 return distance > 0 ? distance : 0; | 2023 return distance > 0 ? distance : 0; |
2023 } | 2024 } |
2024 | 2025 |
2025 } // namespace internal | 2026 } // namespace internal |
2026 } // namespace ash | 2027 } // namespace ash |
OLD | NEW |