| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/workspace/phantom_window_controller.h" | 5 #include "ash/wm/workspace/phantom_window_controller.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 aura::Window* root_window, | 107 aura::Window* root_window, |
| 108 const gfx::Rect& bounds_in_screen) { | 108 const gfx::Rect& bounds_in_screen) { |
| 109 scoped_ptr<views::Widget> phantom_widget(new views::Widget); | 109 scoped_ptr<views::Widget> phantom_widget(new views::Widget); |
| 110 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 110 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| 111 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 111 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 112 // PhantomWindowController is used by FrameMaximizeButton to highlight the | 112 // PhantomWindowController is used by FrameMaximizeButton to highlight the |
| 113 // launcher button. Put the phantom in the same window as the launcher so that | 113 // launcher button. Put the phantom in the same window as the launcher so that |
| 114 // the phantom is visible. | 114 // the phantom is visible. |
| 115 params.parent = Shell::GetContainer(root_window, | 115 params.parent = Shell::GetContainer(root_window, |
| 116 kShellWindowId_ShelfContainer); | 116 kShellWindowId_ShelfContainer); |
| 117 params.can_activate = false; |
| 117 params.keep_on_top = true; | 118 params.keep_on_top = true; |
| 118 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 119 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 119 phantom_widget->set_focus_on_creation(false); | 120 phantom_widget->set_focus_on_creation(false); |
| 120 phantom_widget->Init(params); | 121 phantom_widget->Init(params); |
| 121 phantom_widget->SetVisibilityChangedAnimationsEnabled(false); | 122 phantom_widget->SetVisibilityChangedAnimationsEnabled(false); |
| 122 phantom_widget->GetNativeWindow()->SetName("PhantomWindow"); | 123 phantom_widget->GetNativeWindow()->SetName("PhantomWindow"); |
| 123 phantom_widget->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow); | 124 phantom_widget->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow); |
| 124 phantom_widget->SetBounds(bounds_in_screen); | 125 phantom_widget->SetBounds(bounds_in_screen); |
| 125 phantom_widget->StackAbove(window_); | 126 phantom_widget->StackAbove(window_); |
| 126 | 127 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 140 widget_layer->SetOpacity(0); | 141 widget_layer->SetOpacity(0); |
| 141 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); | 142 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); |
| 142 scoped_setter.SetTransitionDuration( | 143 scoped_setter.SetTransitionDuration( |
| 143 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); | 144 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); |
| 144 widget_layer->SetOpacity(1); | 145 widget_layer->SetOpacity(1); |
| 145 | 146 |
| 146 return phantom_widget.Pass(); | 147 return phantom_widget.Pass(); |
| 147 } | 148 } |
| 148 | 149 |
| 149 } // namespace ash | 150 } // namespace ash |
| OLD | NEW |