OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |