OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/sticky_keys/sticky_keys_overlay.h" | 5 #include "ash/sticky_keys/sticky_keys_overlay.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/sticky_keys/sticky_keys_controller.h" | 9 #include "ash/sticky_keys/sticky_keys_controller.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 views::Widget::InitParams params; | 216 views::Widget::InitParams params; |
217 params.type = views::Widget::InitParams::TYPE_POPUP; | 217 params.type = views::Widget::InitParams::TYPE_POPUP; |
218 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 218 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
219 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 219 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
220 params.accept_events = false; | 220 params.accept_events = false; |
221 params.can_activate = false; | 221 params.can_activate = false; |
222 params.keep_on_top = true; | 222 params.keep_on_top = true; |
223 params.remove_standard_frame = true; | 223 params.remove_standard_frame = true; |
224 params.delegate = overlay_view_; | 224 params.delegate = overlay_view_; |
225 params.bounds = CalculateOverlayBounds(); | 225 params.bounds = CalculateOverlayBounds(); |
226 params.parent = Shell::GetContainer( | 226 params.parent = Shell::GetContainer(Shell::GetTargetRootWindow(), |
227 Shell::GetTargetRootWindow(), | 227 kShellWindowId_OverlayContainer); |
228 internal::kShellWindowId_OverlayContainer); | |
229 overlay_widget_.reset(new views::Widget); | 228 overlay_widget_.reset(new views::Widget); |
230 overlay_widget_->Init(params); | 229 overlay_widget_->Init(params); |
231 overlay_widget_->SetVisibilityChangedAnimationsEnabled(false); | 230 overlay_widget_->SetVisibilityChangedAnimationsEnabled(false); |
232 overlay_widget_->SetContentsView(overlay_view_); | 231 overlay_widget_->SetContentsView(overlay_view_); |
233 overlay_widget_->GetNativeView()->SetName("StickyKeysOverlay"); | 232 overlay_widget_->GetNativeView()->SetName("StickyKeysOverlay"); |
234 } | 233 } |
235 | 234 |
236 StickyKeysOverlay::~StickyKeysOverlay() {} | 235 StickyKeysOverlay::~StickyKeysOverlay() {} |
237 | 236 |
238 void StickyKeysOverlay::Show(bool visible) { | 237 void StickyKeysOverlay::Show(bool visible) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 ui::LayerAnimator* animator = overlay_widget_->GetLayer()->GetAnimator(); | 300 ui::LayerAnimator* animator = overlay_widget_->GetLayer()->GetAnimator(); |
302 if (animator) | 301 if (animator) |
303 animator->RemoveObserver(this); | 302 animator->RemoveObserver(this); |
304 } | 303 } |
305 | 304 |
306 void StickyKeysOverlay::OnLayerAnimationScheduled( | 305 void StickyKeysOverlay::OnLayerAnimationScheduled( |
307 ui::LayerAnimationSequence* sequence) { | 306 ui::LayerAnimationSequence* sequence) { |
308 } | 307 } |
309 | 308 |
310 } // namespace ash | 309 } // namespace ash |
OLD | NEW |