OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_EXO_SHELL_SURFACE_H_ | 5 #ifndef COMPONENTS_EXO_SHELL_SURFACE_H_ |
6 #define COMPONENTS_EXO_SHELL_SURFACE_H_ | 6 #define COMPONENTS_EXO_SHELL_SURFACE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "ash/common/wm/window_state_observer.h" | 12 #include "ash/common/wm/window_state_observer.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "components/exo/surface_delegate.h" | 15 #include "components/exo/surface_delegate.h" |
16 #include "components/exo/surface_observer.h" | 16 #include "components/exo/surface_observer.h" |
| 17 #include "components/exo/wm_helper.h" |
17 #include "ui/aura/window_observer.h" | 18 #include "ui/aura/window_observer.h" |
18 #include "ui/base/hit_test.h" | 19 #include "ui/base/hit_test.h" |
19 #include "ui/gfx/geometry/point.h" | 20 #include "ui/gfx/geometry/point.h" |
20 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
21 #include "ui/gfx/geometry/vector2d.h" | 22 #include "ui/gfx/geometry/vector2d.h" |
22 #include "ui/views/widget/widget_delegate.h" | 23 #include "ui/views/widget/widget_delegate.h" |
23 #include "ui/wm/public/activation_change_observer.h" | |
24 | 24 |
25 namespace ash { | 25 namespace ash { |
26 class WindowResizer; | 26 class WindowResizer; |
27 } | 27 } |
28 | 28 |
29 namespace base { | 29 namespace base { |
30 namespace trace_event { | 30 namespace trace_event { |
31 class TracedValue; | 31 class TracedValue; |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
35 namespace exo { | 35 namespace exo { |
36 class Surface; | 36 class Surface; |
37 | 37 |
38 // This class provides functions for treating a surfaces like toplevel, | 38 // This class provides functions for treating a surfaces like toplevel, |
39 // fullscreen or popup widgets, move, resize or maximize them, associate | 39 // fullscreen or popup widgets, move, resize or maximize them, associate |
40 // metadata like title and class, etc. | 40 // metadata like title and class, etc. |
41 class ShellSurface : public SurfaceDelegate, | 41 class ShellSurface : public SurfaceDelegate, |
42 public SurfaceObserver, | 42 public SurfaceObserver, |
43 public views::WidgetDelegate, | 43 public views::WidgetDelegate, |
44 public views::View, | 44 public views::View, |
45 public ash::wm::WindowStateObserver, | 45 public ash::wm::WindowStateObserver, |
46 public aura::WindowObserver, | 46 public aura::WindowObserver, |
47 public aura::client::ActivationChangeObserver { | 47 public WMHelper::ActivationObserver { |
48 public: | 48 public: |
49 ShellSurface(Surface* surface, | 49 ShellSurface(Surface* surface, |
50 ShellSurface* parent, | 50 ShellSurface* parent, |
51 const gfx::Rect& initial_bounds, | 51 const gfx::Rect& initial_bounds, |
52 bool activatable, | 52 bool activatable, |
53 int container); | 53 int container); |
54 explicit ShellSurface(Surface* surface); | 54 explicit ShellSurface(Surface* surface); |
55 ~ShellSurface() override; | 55 ~ShellSurface() override; |
56 | 56 |
57 // Set the callback to run when the user wants the shell surface to be closed. | 57 // Set the callback to run when the user wants the shell surface to be closed. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 ash::wm::WindowStateType old_type) override; | 199 ash::wm::WindowStateType old_type) override; |
200 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state, | 200 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state, |
201 ash::wm::WindowStateType old_type) override; | 201 ash::wm::WindowStateType old_type) override; |
202 | 202 |
203 // Overridden from aura::WindowObserver: | 203 // Overridden from aura::WindowObserver: |
204 void OnWindowBoundsChanged(aura::Window* window, | 204 void OnWindowBoundsChanged(aura::Window* window, |
205 const gfx::Rect& old_bounds, | 205 const gfx::Rect& old_bounds, |
206 const gfx::Rect& new_bounds) override; | 206 const gfx::Rect& new_bounds) override; |
207 void OnWindowDestroying(aura::Window* window) override; | 207 void OnWindowDestroying(aura::Window* window) override; |
208 | 208 |
209 // Overridden from aura::client::ActivationChangeObserver: | 209 // Overridden from WMHelper::ActivationObserver: |
210 void OnWindowActivated( | 210 void OnWindowActivated( |
211 aura::client::ActivationChangeObserver::ActivationReason reason, | |
212 aura::Window* gained_active, | 211 aura::Window* gained_active, |
213 aura::Window* lost_active) override; | 212 aura::Window* lost_active) override; |
214 | 213 |
215 // Overridden from ui::EventHandler: | 214 // Overridden from ui::EventHandler: |
216 void OnKeyEvent(ui::KeyEvent* event) override; | 215 void OnKeyEvent(ui::KeyEvent* event) override; |
217 void OnMouseEvent(ui::MouseEvent* event) override; | 216 void OnMouseEvent(ui::MouseEvent* event) override; |
218 | 217 |
219 // Overridden from ui::AcceleratorTarget: | 218 // Overridden from ui::AcceleratorTarget: |
220 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 219 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
221 | 220 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 int top_inset_height_ = 0; | 298 int top_inset_height_ = 0; |
300 int pending_top_inset_height_ = 0; | 299 int pending_top_inset_height_ = 0; |
301 float rectangular_shadow_background_opacity_ = 1.0; | 300 float rectangular_shadow_background_opacity_ = 1.0; |
302 | 301 |
303 DISALLOW_COPY_AND_ASSIGN(ShellSurface); | 302 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
304 }; | 303 }; |
305 | 304 |
306 } // namespace exo | 305 } // namespace exo |
307 | 306 |
308 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ | 307 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
OLD | NEW |