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

Side by Side Diff: ash/wm/overview/window_selector.cc

Issue 2860163005: chromeos: gets rid of wm_screen_util (Closed)
Patch Set: include Created 3 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/wm/overview/window_selector.h" 5 #include "ash/wm/overview/window_selector.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "ash/accessibility_delegate.h" 13 #include "ash/accessibility_delegate.h"
14 #include "ash/accessibility_types.h" 14 #include "ash/accessibility_types.h"
15 #include "ash/metrics/user_metrics_action.h" 15 #include "ash/metrics/user_metrics_action.h"
16 #include "ash/public/cpp/shell_window_ids.h" 16 #include "ash/public/cpp/shell_window_ids.h"
17 #include "ash/root_window_controller.h" 17 #include "ash/root_window_controller.h"
18 #include "ash/screen_util.h"
18 #include "ash/shelf/wm_shelf.h" 19 #include "ash/shelf/wm_shelf.h"
19 #include "ash/shell.h" 20 #include "ash/shell.h"
20 #include "ash/shell_port.h" 21 #include "ash/shell_port.h"
21 #include "ash/wm/mru_window_tracker.h" 22 #include "ash/wm/mru_window_tracker.h"
22 #include "ash/wm/overview/window_grid.h" 23 #include "ash/wm/overview/window_grid.h"
23 #include "ash/wm/overview/window_selector_delegate.h" 24 #include "ash/wm/overview/window_selector_delegate.h"
24 #include "ash/wm/overview/window_selector_item.h" 25 #include "ash/wm/overview/window_selector_item.h"
25 #include "ash/wm/panels/panel_layout_manager.h" 26 #include "ash/wm/panels/panel_layout_manager.h"
26 #include "ash/wm/switchable_windows.h" 27 #include "ash/wm/switchable_windows.h"
27 #include "ash/wm/window_state.h" 28 #include "ash/wm/window_state.h"
28 #include "ash/wm/window_util.h" 29 #include "ash/wm/window_util.h"
29 #include "ash/wm/wm_screen_util.h"
30 #include "ash/wm_window.h" 30 #include "ash/wm_window.h"
31 #include "base/auto_reset.h" 31 #include "base/auto_reset.h"
32 #include "base/command_line.h" 32 #include "base/command_line.h"
33 #include "base/metrics/histogram_macros.h" 33 #include "base/metrics/histogram_macros.h"
34 #include "third_party/skia/include/core/SkPath.h" 34 #include "third_party/skia/include/core/SkPath.h"
35 #include "ui/base/resource/resource_bundle.h" 35 #include "ui/base/resource/resource_bundle.h"
36 #include "ui/compositor/scoped_layer_animation_settings.h" 36 #include "ui/compositor/scoped_layer_animation_settings.h"
37 #include "ui/display/screen.h" 37 #include "ui/display/screen.h"
38 #include "ui/events/event.h" 38 #include "ui/events/event.h"
39 #include "ui/gfx/canvas.h" 39 #include "ui/gfx/canvas.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 }; 130 };
131 131
132 // Triggers a shelf visibility update on all root window controllers. 132 // Triggers a shelf visibility update on all root window controllers.
133 void UpdateShelfVisibility() { 133 void UpdateShelfVisibility() {
134 for (WmWindow* root : ShellPort::Get()->GetAllRootWindows()) 134 for (WmWindow* root : ShellPort::Get()->GetAllRootWindows())
135 WmShelf::ForWindow(root)->UpdateVisibilityState(); 135 WmShelf::ForWindow(root)->UpdateVisibilityState();
136 } 136 }
137 137
138 gfx::Rect GetTextFilterPosition(WmWindow* root_window) { 138 gfx::Rect GetTextFilterPosition(WmWindow* root_window) {
139 gfx::Rect total_bounds = root_window->ConvertRectToScreen( 139 gfx::Rect total_bounds = root_window->ConvertRectToScreen(
140 wm::GetDisplayWorkAreaBoundsInParent(root_window->GetChildByShellWindowId( 140 ScreenUtil::GetDisplayWorkAreaBoundsInParent(
141 kShellWindowId_DefaultContainer))); 141 root_window->GetChildByShellWindowId(kShellWindowId_DefaultContainer)
142 ->aura_window()));
142 return gfx::Rect( 143 return gfx::Rect(
143 0.5 * (total_bounds.width() - 144 0.5 * (total_bounds.width() -
144 std::min(kTextFilterWidth, total_bounds.width())), 145 std::min(kTextFilterWidth, total_bounds.width())),
145 total_bounds.y() + total_bounds.height() * kTextFilterTopScreenProportion, 146 total_bounds.y() + total_bounds.height() * kTextFilterTopScreenProportion,
146 std::min(kTextFilterWidth, total_bounds.width()), kTextFilterHeight); 147 std::min(kTextFilterWidth, total_bounds.width()), kTextFilterHeight);
147 } 148 }
148 149
149 // Initializes the text filter on the top of the main root window and requests 150 // Initializes the text filter on the top of the main root window and requests
150 // focus on its textfield. Uses |image| to place an icon to the left of the text 151 // focus on its textfield. Uses |image| to place an icon to the left of the text
151 // field. 152 // field.
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 for (size_t i = 0; i <= grid_list_.size() && 682 for (size_t i = 0; i <= grid_list_.size() &&
682 grid_list_[selected_grid_index_]->Move(direction, animate); 683 grid_list_[selected_grid_index_]->Move(direction, animate);
683 i++) { 684 i++) {
684 selected_grid_index_ = 685 selected_grid_index_ =
685 (selected_grid_index_ + display_direction + grid_list_.size()) % 686 (selected_grid_index_ + display_direction + grid_list_.size()) %
686 grid_list_.size(); 687 grid_list_.size();
687 } 688 }
688 } 689 }
689 690
690 } // namespace ash 691 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698