Chromium Code Reviews| 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 #ifndef ASH_WM_WORKSPACE_PHANTOM_WINDOW_CONTROLLER_H_ | 5 #ifndef ASH_WM_WORKSPACE_PHANTOM_WINDOW_CONTROLLER_H_ |
| 6 #define ASH_WM_WORKSPACE_PHANTOM_WINDOW_CONTROLLER_H_ | 6 #define ASH_WM_WORKSPACE_PHANTOM_WINDOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 // This is used to set bounds for the phantom window immediately. This should | 43 // This is used to set bounds for the phantom window immediately. This should |
| 44 // be called only when the phantom window is already visible. | 44 // be called only when the phantom window is already visible. |
| 45 void SetBounds(const gfx::Rect& bounds); | 45 void SetBounds(const gfx::Rect& bounds); |
| 46 | 46 |
| 47 // Hides the phantom. | 47 // Hides the phantom. |
| 48 void Hide(); | 48 void Hide(); |
| 49 | 49 |
| 50 // Returns true if the phantom is showing. | 50 // Returns true if the phantom is showing. |
| 51 bool IsShowing() const; | 51 bool IsShowing() const; |
| 52 | 52 |
| 53 // Stack the phantom window above the given window upon creation, but below | |
|
sky
2012/07/31 16:11:06
How about: If set the phantom window is stacked be
Mr4D (OOO till 08-26)
2012/08/01 20:48:22
Done.
| |
| 54 // this one. | |
| 55 void set_phantom_below_window(aura::Window* phantom_below_window) { | |
| 56 phantom_below_window_ = phantom_below_window; | |
| 57 } | |
| 58 | |
| 53 // ui::AnimationDelegate overrides: | 59 // ui::AnimationDelegate overrides: |
| 54 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 60 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
| 55 | 61 |
| 56 private: | 62 private: |
| 57 // Creates and shows the |phantom_widget_| at |bounds|. | 63 // Creates and shows the |phantom_widget_| at |bounds|. |
| 58 void CreatePhantomWidget(const gfx::Rect& bounds); | 64 void CreatePhantomWidget(const gfx::Rect& bounds); |
| 59 | 65 |
| 60 // Window the phantom is placed beneath. | 66 // Window the phantom is placed beneath. |
| 61 aura::Window* window_; | 67 aura::Window* window_; |
| 62 | 68 |
| 69 // If set, the phantom window should get stacked below this window. | |
| 70 aura::Window* phantom_below_window_; | |
| 71 | |
| 63 // Initially the bounds of |window_|. Each time Show() is invoked | 72 // Initially the bounds of |window_|. Each time Show() is invoked |
| 64 // |start_bounds_| is then reset to the bounds of |phantom_widget_| and | 73 // |start_bounds_| is then reset to the bounds of |phantom_widget_| and |
| 65 // |bounds_| is set to the value passed into Show(). The animation animates | 74 // |bounds_| is set to the value passed into Show(). The animation animates |
| 66 // between these two values. | 75 // between these two values. |
| 67 gfx::Rect start_bounds_; | 76 gfx::Rect start_bounds_; |
| 68 gfx::Rect bounds_; | 77 gfx::Rect bounds_; |
| 69 | 78 |
| 70 scoped_ptr<views::Widget> phantom_widget_; | 79 scoped_ptr<views::Widget> phantom_widget_; |
| 71 | 80 |
| 72 // Used to transition the bounds. | 81 // Used to transition the bounds. |
| 73 scoped_ptr<ui::SlideAnimation> animation_; | 82 scoped_ptr<ui::SlideAnimation> animation_; |
| 74 | 83 |
| 75 DISALLOW_COPY_AND_ASSIGN(PhantomWindowController); | 84 DISALLOW_COPY_AND_ASSIGN(PhantomWindowController); |
| 76 }; | 85 }; |
| 77 | 86 |
| 78 } // namespace internal | 87 } // namespace internal |
| 79 } // namespace ash | 88 } // namespace ash |
| 80 | 89 |
| 81 #endif // ASH_WM_WORKSPACE_PHANTOM_WINDOW_CONTROLLER_H_ | 90 #endif // ASH_WM_WORKSPACE_PHANTOM_WINDOW_CONTROLLER_H_ |
| OLD | NEW |