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

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

Issue 251103005: Added arrow key navigation to Overview Mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replaced unittest by a better one, fixed lints, minor tweaks. Created 6 years, 6 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_item.h" 5 #include "ash/wm/overview/window_selector_item.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/overview/scoped_transform_overview_window.h" 10 #include "ash/wm/overview/scoped_transform_overview_window.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void WindowSelectorItem::RecomputeWindowTransforms() { 113 void WindowSelectorItem::RecomputeWindowTransforms() {
114 if (in_bounds_update_ || target_bounds_.IsEmpty()) 114 if (in_bounds_update_ || target_bounds_.IsEmpty())
115 return; 115 return;
116 DCHECK(root_window_); 116 DCHECK(root_window_);
117 base::AutoReset<bool> auto_reset_in_bounds_update(&in_bounds_update_, true); 117 base::AutoReset<bool> auto_reset_in_bounds_update(&in_bounds_update_, true);
118 gfx::Rect inset_bounds(target_bounds_); 118 gfx::Rect inset_bounds(target_bounds_);
119 inset_bounds.Inset(kWindowMargin, kWindowMargin); 119 inset_bounds.Inset(kWindowMargin, kWindowMargin);
120 SetItemBounds(root_window_, inset_bounds, false); 120 SetItemBounds(root_window_, inset_bounds, false);
121 } 121 }
122 122
123 void WindowSelectorItem::SendFocusAlert() const {
124 activate_window_button_->SendFocusAlert();
125 }
126
123 void WindowSelectorItem::UpdateWindowLabels(const gfx::Rect& window_bounds, 127 void WindowSelectorItem::UpdateWindowLabels(const gfx::Rect& window_bounds,
124 aura::Window* root_window, 128 aura::Window* root_window,
125 bool animate) { 129 bool animate) {
126 gfx::Rect converted_bounds = ScreenUtil::ConvertRectFromScreen(root_window, 130 gfx::Rect converted_bounds = ScreenUtil::ConvertRectFromScreen(root_window,
127 window_bounds); 131 window_bounds);
128 gfx::Rect label_bounds(converted_bounds.x(), 132 gfx::Rect label_bounds(converted_bounds.x(),
129 converted_bounds.bottom(), 133 converted_bounds.bottom(),
130 converted_bounds.width(), 134 converted_bounds.width(),
131 0); 135 0);
132 136
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( 178 settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
175 ScopedTransformOverviewWindow::kTransitionMilliseconds)); 179 ScopedTransformOverviewWindow::kTransitionMilliseconds));
176 window_label_->GetNativeWindow()->SetBounds(label_bounds); 180 window_label_->GetNativeWindow()->SetBounds(label_bounds);
177 } else { 181 } else {
178 window_label_->GetNativeWindow()->SetBounds(label_bounds); 182 window_label_->GetNativeWindow()->SetBounds(label_bounds);
179 } 183 }
180 } 184 }
181 } 185 }
182 186
183 } // namespace ash 187 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698