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_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <cstring> | 9 #include <cstring> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "ash/ash_switches.h" | 13 #include "ash/ash_switches.h" |
14 #include "ash/launcher/launcher.h" | 14 #include "ash/launcher/launcher.h" |
15 #include "ash/launcher/launcher_types.h" | 15 #include "ash/launcher/launcher_types.h" |
16 #include "ash/root_window_controller.h" | 16 #include "ash/root_window_controller.h" |
17 #include "ash/screen_ash.h" | 17 #include "ash/screen_ash.h" |
18 #include "ash/session_state_delegate.h" | 18 #include "ash/session_state_delegate.h" |
19 #include "ash/shelf/shelf_bezel_event_filter.h" | 19 #include "ash/shelf/shelf_bezel_event_filter.h" |
20 #include "ash/shelf/shelf_layout_manager_observer.h" | 20 #include "ash/shelf/shelf_layout_manager_observer.h" |
21 #include "ash/shelf/shelf_widget.h" | 21 #include "ash/shelf/shelf_widget.h" |
22 #include "ash/shell.h" | 22 #include "ash/shell.h" |
23 #include "ash/shell_window_ids.h" | 23 #include "ash/shell_window_ids.h" |
24 #include "ash/system/status_area_widget.h" | 24 #include "ash/system/status_area_widget.h" |
25 #include "ash/wm/gestures/shelf_gesture_handler.h" | 25 #include "ash/wm/gestures/shelf_gesture_handler.h" |
26 #include "ash/wm/lock_state_controller.h" | 26 #include "ash/wm/lock_state_controller.h" |
27 #include "ash/wm/mru_window_tracker.h" | 27 #include "ash/wm/mru_window_tracker.h" |
28 #include "ash/wm/window_animations.h" | 28 #include "ash/wm/window_animations.h" |
29 #include "ash/wm/window_properties.h" | 29 #include "ash/wm/window_properties.h" |
| 30 #include "ash/wm/window_state.h" |
30 #include "ash/wm/window_util.h" | 31 #include "ash/wm/window_util.h" |
31 #include "ash/wm/workspace_controller.h" | 32 #include "ash/wm/workspace_controller.h" |
32 #include "base/auto_reset.h" | 33 #include "base/auto_reset.h" |
33 #include "base/command_line.h" | 34 #include "base/command_line.h" |
34 #include "base/command_line.h" | 35 #include "base/command_line.h" |
35 #include "base/i18n/rtl.h" | 36 #include "base/i18n/rtl.h" |
36 #include "base/strings/string_number_conversions.h" | 37 #include "base/strings/string_number_conversions.h" |
37 #include "base/strings/string_util.h" | 38 #include "base/strings/string_util.h" |
38 #include "ui/aura/client/activation_client.h" | 39 #include "ui/aura/client/activation_client.h" |
39 #include "ui/aura/client/cursor_client.h" | 40 #include "ui/aura/client/cursor_client.h" |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 if (shelf_->IsActive() || shelf_->status_area_widget()->IsActive()) | 1004 if (shelf_->IsActive() || shelf_->status_area_widget()->IsActive()) |
1004 return SHELF_AUTO_HIDE_SHOWN; | 1005 return SHELF_AUTO_HIDE_SHOWN; |
1005 | 1006 |
1006 const std::vector<aura::Window*> windows = | 1007 const std::vector<aura::Window*> windows = |
1007 ash::MruWindowTracker::BuildWindowList(false); | 1008 ash::MruWindowTracker::BuildWindowList(false); |
1008 | 1009 |
1009 // Process the window list and check if there are any visible windows. | 1010 // Process the window list and check if there are any visible windows. |
1010 bool visible_window = false; | 1011 bool visible_window = false; |
1011 for (size_t i = 0; i < windows.size(); ++i) { | 1012 for (size_t i = 0; i < windows.size(); ++i) { |
1012 if (windows[i] && windows[i]->IsVisible() && | 1013 if (windows[i] && windows[i]->IsVisible() && |
1013 !ash::wm::IsWindowMinimized(windows[i]) && | 1014 !wm::GetWindowState(windows[i])->IsMinimized() && |
1014 root_window_ == windows[i]->GetRootWindow()) { | 1015 root_window_ == windows[i]->GetRootWindow()) { |
1015 visible_window = true; | 1016 visible_window = true; |
1016 break; | 1017 break; |
1017 } | 1018 } |
1018 } | 1019 } |
1019 // If there are no visible windows do not hide the shelf. | 1020 // If there are no visible windows do not hide the shelf. |
1020 if (!visible_window) | 1021 if (!visible_window) |
1021 return SHELF_AUTO_HIDE_SHOWN; | 1022 return SHELF_AUTO_HIDE_SHOWN; |
1022 | 1023 |
1023 if (gesture_drag_status_ == GESTURE_DRAG_COMPLETE_IN_PROGRESS) | 1024 if (gesture_drag_status_ == GESTURE_DRAG_COMPLETE_IN_PROGRESS) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 return gfx::Insets(0, distance, 0, 0); | 1155 return gfx::Insets(0, distance, 0, 0); |
1155 case SHELF_ALIGNMENT_TOP: | 1156 case SHELF_ALIGNMENT_TOP: |
1156 return gfx::Insets(0, 0, distance, 0); | 1157 return gfx::Insets(0, 0, distance, 0); |
1157 } | 1158 } |
1158 NOTREACHED(); | 1159 NOTREACHED(); |
1159 return gfx::Insets(); | 1160 return gfx::Insets(); |
1160 } | 1161 } |
1161 | 1162 |
1162 } // namespace internal | 1163 } // namespace internal |
1163 } // namespace ash | 1164 } // namespace ash |
OLD | NEW |