Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Side by Side Diff: ash/shelf/shelf_layout_manager.cc

Issue 20708005: Refactor most recently used window tracking into a separate class. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/focus_cycler.cc ('k') | ash/shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/mru_window_tracker.h"
26 #include "ash/wm/property_util.h" 27 #include "ash/wm/property_util.h"
27 #include "ash/wm/window_cycle_controller.h"
28 #include "ash/wm/window_properties.h" 28 #include "ash/wm/window_properties.h"
29 #include "ash/wm/window_util.h" 29 #include "ash/wm/window_util.h"
30 #include "ash/wm/workspace/workspace_animations.h" 30 #include "ash/wm/workspace/workspace_animations.h"
31 #include "ash/wm/workspace_controller.h" 31 #include "ash/wm/workspace_controller.h"
32 #include "base/auto_reset.h" 32 #include "base/auto_reset.h"
33 #include "base/command_line.h" 33 #include "base/command_line.h"
34 #include "base/command_line.h" 34 #include "base/command_line.h"
35 #include "base/i18n/rtl.h" 35 #include "base/i18n/rtl.h"
36 #include "base/strings/string_number_conversions.h" 36 #include "base/strings/string_number_conversions.h"
37 #include "base/strings/string_util.h" 37 #include "base/strings/string_util.h"
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 alignment_ == SHELF_ALIGNMENT_LEFT ? 933 alignment_ == SHELF_ALIGNMENT_LEFT ?
934 -kNotificationBubbleGapHeight : 0, 934 -kNotificationBubbleGapHeight : 0,
935 alignment_ == SHELF_ALIGNMENT_TOP ? 935 alignment_ == SHELF_ALIGNMENT_TOP ?
936 -kNotificationBubbleGapHeight : 0); 936 -kNotificationBubbleGapHeight : 0);
937 } 937 }
938 938
939 if (shelf_region.Contains(Shell::GetScreen()->GetCursorScreenPoint())) 939 if (shelf_region.Contains(Shell::GetScreen()->GetCursorScreenPoint()))
940 return SHELF_AUTO_HIDE_SHOWN; 940 return SHELF_AUTO_HIDE_SHOWN;
941 941
942 const std::vector<aura::Window*> windows = 942 const std::vector<aura::Window*> windows =
943 ash::WindowCycleController::BuildWindowList(NULL, false); 943 ash::MruWindowTracker::BuildWindowList(false);
944 944
945 // Process the window list and check if there are any visible windows. 945 // Process the window list and check if there are any visible windows.
946 for (size_t i = 0; i < windows.size(); ++i) { 946 for (size_t i = 0; i < windows.size(); ++i) {
947 if (windows[i] && windows[i]->IsVisible() && 947 if (windows[i] && windows[i]->IsVisible() &&
948 !ash::wm::IsWindowMinimized(windows[i]) && 948 !ash::wm::IsWindowMinimized(windows[i]) &&
949 root_window_ == windows[i]->GetRootWindow()) 949 root_window_ == windows[i]->GetRootWindow())
950 return SHELF_AUTO_HIDE_HIDDEN; 950 return SHELF_AUTO_HIDE_HIDDEN;
951 } 951 }
952 952
953 // If there are no visible windows do not hide the shelf. 953 // If there are no visible windows do not hide the shelf.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 return gfx::Insets(0, distance, 0, 0); 1020 return gfx::Insets(0, distance, 0, 0);
1021 case SHELF_ALIGNMENT_TOP: 1021 case SHELF_ALIGNMENT_TOP:
1022 return gfx::Insets(0, 0, distance, 0); 1022 return gfx::Insets(0, 0, distance, 0);
1023 } 1023 }
1024 NOTREACHED(); 1024 NOTREACHED();
1025 return gfx::Insets(); 1025 return gfx::Insets();
1026 } 1026 }
1027 1027
1028 } // namespace internal 1028 } // namespace internal
1029 } // namespace ash 1029 } // namespace ash
OLDNEW
« no previous file with comments | « ash/focus_cycler.cc ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698