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_overview.h" | 5 #include "ash/wm/overview/window_overview.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/accessibility_delegate.h" | |
9 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" |
10 #include "ash/screen_util.h" | 11 #include "ash/screen_util.h" |
11 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "ash/shell_delegate.h" | |
tdanderson
2014/04/28 15:34:39
I don't think you need this #include.
Nina
2014/04/28 17:24:43
Done.
| |
12 #include "ash/shell_window_ids.h" | 14 #include "ash/shell_window_ids.h" |
13 #include "ash/switchable_windows.h" | 15 #include "ash/switchable_windows.h" |
14 #include "ash/wm/overview/scoped_transform_overview_window.h" | 16 #include "ash/wm/overview/scoped_transform_overview_window.h" |
15 #include "ash/wm/overview/window_selector.h" | 17 #include "ash/wm/overview/window_selector.h" |
16 #include "ash/wm/overview/window_selector_item.h" | 18 #include "ash/wm/overview/window_selector_item.h" |
17 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
18 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
19 #include "ui/aura/client/cursor_client.h" | 21 #include "ui/aura/client/cursor_client.h" |
20 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
21 #include "ui/aura/window_event_dispatcher.h" | 23 #include "ui/aura/window_event_dispatcher.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 cursor_client_->ShowCursor(); | 143 cursor_client_->ShowCursor(); |
142 // TODO(flackr): Only prevent cursor changes for windows in the overview. | 144 // TODO(flackr): Only prevent cursor changes for windows in the overview. |
143 // This will be easier to do without exposing the overview mode code if the | 145 // This will be easier to do without exposing the overview mode code if the |
144 // cursor changes are moved to ToplevelWindowEventHandler::HandleMouseMoved | 146 // cursor changes are moved to ToplevelWindowEventHandler::HandleMouseMoved |
145 // as suggested there. | 147 // as suggested there. |
146 cursor_client_->LockCursor(); | 148 cursor_client_->LockCursor(); |
147 } | 149 } |
148 shell->PrependPreTargetHandler(this); | 150 shell->PrependPreTargetHandler(this); |
149 shell->metrics()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW); | 151 shell->metrics()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW); |
150 HideAndTrackNonOverviewWindows(); | 152 HideAndTrackNonOverviewWindows(); |
153 Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert( | |
tdanderson
2014/04/28 15:34:39
Is accessibility_delegate() guaranteed to be non-N
Nina
2014/04/28 17:24:43
Apparently yes
| |
154 A11Y_ALERT_WINDOW_OVERVIEW_STARTING); | |
tdanderson
2014/04/28 15:34:39
Indent should be length 4 here.
Nina
2014/04/28 17:24:43
Done.
| |
151 } | 155 } |
152 | 156 |
153 WindowOverview::~WindowOverview() { | 157 WindowOverview::~WindowOverview() { |
154 const aura::WindowTracker::Windows hidden_windows = hidden_windows_.windows(); | 158 const aura::WindowTracker::Windows hidden_windows = hidden_windows_.windows(); |
155 for (aura::WindowTracker::Windows::const_iterator iter = | 159 for (aura::WindowTracker::Windows::const_iterator iter = |
156 hidden_windows.begin(); iter != hidden_windows.end(); ++iter) { | 160 hidden_windows.begin(); iter != hidden_windows.end(); ++iter) { |
157 ui::ScopedLayerAnimationSettings settings( | 161 ui::ScopedLayerAnimationSettings settings( |
158 (*iter)->layer()->GetAnimator()); | 162 (*iter)->layer()->GetAnimator()); |
159 settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 163 settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
160 ScopedTransformOverviewWindow::kTransitionMilliseconds)); | 164 ScopedTransformOverviewWindow::kTransitionMilliseconds)); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
453 } | 457 } |
454 | 458 |
455 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { | 459 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { |
456 gfx::Rect bounds((*windows_)[index]->bounds()); | 460 gfx::Rect bounds((*windows_)[index]->bounds()); |
457 bounds.Inset(-kWindowOverviewSelectionPadding, | 461 bounds.Inset(-kWindowOverviewSelectionPadding, |
458 -kWindowOverviewSelectionPadding); | 462 -kWindowOverviewSelectionPadding); |
459 return bounds; | 463 return bounds; |
460 } | 464 } |
461 | 465 |
462 } // namespace ash | 466 } // namespace ash |
OLD | NEW |