| 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/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/sticky_keys/sticky_keys_controller.h" | 9 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 10 #include "ash/strings/grit/ash_strings.h" | 10 #include "ash/strings/grit/ash_strings.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 overlay_view_(new StickyKeysOverlayView), | 207 overlay_view_(new StickyKeysOverlayView), |
| 208 widget_size_(overlay_view_->GetPreferredSize()) { | 208 widget_size_(overlay_view_->GetPreferredSize()) { |
| 209 views::Widget::InitParams params; | 209 views::Widget::InitParams params; |
| 210 params.type = views::Widget::InitParams::TYPE_POPUP; | 210 params.type = views::Widget::InitParams::TYPE_POPUP; |
| 211 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 211 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 212 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 212 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 213 params.accept_events = false; | 213 params.accept_events = false; |
| 214 params.keep_on_top = true; | 214 params.keep_on_top = true; |
| 215 params.remove_standard_frame = true; | 215 params.remove_standard_frame = true; |
| 216 params.bounds = CalculateOverlayBounds(); | 216 params.bounds = CalculateOverlayBounds(); |
| 217 params.parent = Shell::GetContainer(Shell::GetTargetRootWindow(), | 217 params.parent = Shell::GetContainer(Shell::GetRootWindowForNewWindows(), |
| 218 kShellWindowId_OverlayContainer); | 218 kShellWindowId_OverlayContainer); |
| 219 overlay_widget_.reset(new views::Widget); | 219 overlay_widget_.reset(new views::Widget); |
| 220 overlay_widget_->Init(params); | 220 overlay_widget_->Init(params); |
| 221 overlay_widget_->SetVisibilityChangedAnimationsEnabled(false); | 221 overlay_widget_->SetVisibilityChangedAnimationsEnabled(false); |
| 222 overlay_widget_->SetContentsView(overlay_view_.get()); | 222 overlay_widget_->SetContentsView(overlay_view_.get()); |
| 223 overlay_widget_->GetNativeView()->SetName("StickyKeysOverlay"); | 223 overlay_widget_->GetNativeView()->SetName("StickyKeysOverlay"); |
| 224 } | 224 } |
| 225 | 225 |
| 226 StickyKeysOverlay::~StickyKeysOverlay() { | 226 StickyKeysOverlay::~StickyKeysOverlay() { |
| 227 // Remove ourself from the animator to avoid being re-entrantly called in | 227 // Remove ourself from the animator to avoid being re-entrantly called in |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 ui::LayerAnimationSequence* sequence) { | 306 ui::LayerAnimationSequence* sequence) { |
| 307 ui::LayerAnimator* animator = overlay_widget_->GetLayer()->GetAnimator(); | 307 ui::LayerAnimator* animator = overlay_widget_->GetLayer()->GetAnimator(); |
| 308 if (animator) | 308 if (animator) |
| 309 animator->RemoveObserver(this); | 309 animator->RemoveObserver(this); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void StickyKeysOverlay::OnLayerAnimationScheduled( | 312 void StickyKeysOverlay::OnLayerAnimationScheduled( |
| 313 ui::LayerAnimationSequence* sequence) {} | 313 ui::LayerAnimationSequence* sequence) {} |
| 314 | 314 |
| 315 } // namespace ash | 315 } // namespace ash |
| OLD | NEW |