Chromium Code Reviews| 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/system/accessibility_observer.h" | |
| 12 #include "ash/common/wm/window_state_observer.h" | 13 #include "ash/common/wm/window_state_observer.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 15 #include "components/exo/surface_delegate.h" | 16 #include "components/exo/surface_delegate.h" |
| 16 #include "components/exo/surface_observer.h" | 17 #include "components/exo/surface_observer.h" |
| 17 #include "components/exo/wm_helper.h" | 18 #include "components/exo/wm_helper.h" |
| 18 #include "ui/aura/window_observer.h" | 19 #include "ui/aura/window_observer.h" |
| 19 #include "ui/base/hit_test.h" | 20 #include "ui/base/hit_test.h" |
| 20 #include "ui/gfx/geometry/point.h" | 21 #include "ui/gfx/geometry/point.h" |
| 21 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 35 namespace exo { | 36 namespace exo { |
| 36 class Surface; | 37 class Surface; |
| 37 | 38 |
| 38 // This class provides functions for treating a surfaces like toplevel, | 39 // This class provides functions for treating a surfaces like toplevel, |
| 39 // fullscreen or popup widgets, move, resize or maximize them, associate | 40 // fullscreen or popup widgets, move, resize or maximize them, associate |
| 40 // metadata like title and class, etc. | 41 // metadata like title and class, etc. |
| 41 class ShellSurface : public SurfaceDelegate, | 42 class ShellSurface : public SurfaceDelegate, |
| 42 public SurfaceObserver, | 43 public SurfaceObserver, |
| 43 public views::WidgetDelegate, | 44 public views::WidgetDelegate, |
| 44 public views::View, | 45 public views::View, |
| 46 public ash::AccessibilityObserver, | |
| 45 public ash::wm::WindowStateObserver, | 47 public ash::wm::WindowStateObserver, |
| 46 public aura::WindowObserver, | 48 public aura::WindowObserver, |
| 47 public WMHelper::ActivationObserver { | 49 public WMHelper::ActivationObserver { |
| 48 public: | 50 public: |
| 49 ShellSurface(Surface* surface, | 51 ShellSurface(Surface* surface, |
| 50 ShellSurface* parent, | 52 ShellSurface* parent, |
| 51 const gfx::Rect& initial_bounds, | 53 const gfx::Rect& initial_bounds, |
| 52 bool activatable, | 54 bool activatable, |
| 53 int container); | 55 int container); |
| 54 explicit ShellSurface(Surface* surface); | 56 explicit ShellSurface(Surface* surface); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 const views::Widget* GetWidget() const override; | 189 const views::Widget* GetWidget() const override; |
| 188 views::View* GetContentsView() override; | 190 views::View* GetContentsView() override; |
| 189 views::NonClientFrameView* CreateNonClientFrameView( | 191 views::NonClientFrameView* CreateNonClientFrameView( |
| 190 views::Widget* widget) override; | 192 views::Widget* widget) override; |
| 191 bool WidgetHasHitTestMask() const override; | 193 bool WidgetHasHitTestMask() const override; |
| 192 void GetWidgetHitTestMask(gfx::Path* mask) const override; | 194 void GetWidgetHitTestMask(gfx::Path* mask) const override; |
| 193 | 195 |
| 194 // Overridden from views::View: | 196 // Overridden from views::View: |
| 195 gfx::Size GetPreferredSize() const override; | 197 gfx::Size GetPreferredSize() const override; |
| 196 | 198 |
| 199 // Overridden from ash::AccessibilityObserver: | |
| 200 void OnAccessibilityModeChanged( | |
| 201 ash::AccessibilityNotificationVisibility notify) override; | |
| 202 | |
| 197 // Overridden from ash::wm::WindowStateObserver: | 203 // Overridden from ash::wm::WindowStateObserver: |
| 198 void OnPreWindowStateTypeChange(ash::wm::WindowState* window_state, | 204 void OnPreWindowStateTypeChange(ash::wm::WindowState* window_state, |
| 199 ash::wm::WindowStateType old_type) override; | 205 ash::wm::WindowStateType old_type) override; |
| 200 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state, | 206 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state, |
| 201 ash::wm::WindowStateType old_type) override; | 207 ash::wm::WindowStateType old_type) override; |
| 202 | 208 |
| 203 // Overridden from aura::WindowObserver: | 209 // Overridden from aura::WindowObserver: |
| 204 void OnWindowBoundsChanged(aura::Window* window, | 210 void OnWindowBoundsChanged(aura::Window* window, |
| 205 const gfx::Rect& old_bounds, | 211 const gfx::Rect& old_bounds, |
| 206 const gfx::Rect& new_bounds) override; | 212 const gfx::Rect& new_bounds) override; |
| 207 void OnWindowDestroying(aura::Window* window) override; | 213 void OnWindowDestroying(aura::Window* window) override; |
| 208 | 214 |
| 209 // Overridden from WMHelper::ActivationObserver: | 215 // Overridden from WMHelper::ActivationObserver: |
| 210 void OnWindowActivated( | 216 void OnWindowActivated( |
| 211 aura::Window* gained_active, | 217 aura::Window* gained_active, |
| 212 aura::Window* lost_active) override; | 218 aura::Window* lost_active) override; |
| 213 | 219 |
| 214 // Overridden from ui::EventHandler: | 220 // Overridden from ui::EventHandler: |
| 221 void OnEvent(ui::Event* event) override; | |
| 215 void OnKeyEvent(ui::KeyEvent* event) override; | 222 void OnKeyEvent(ui::KeyEvent* event) override; |
| 216 void OnMouseEvent(ui::MouseEvent* event) override; | 223 void OnMouseEvent(ui::MouseEvent* event) override; |
| 217 | 224 |
| 218 // Overridden from ui::AcceleratorTarget: | 225 // Overridden from ui::AcceleratorTarget: |
| 219 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 226 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 220 | 227 |
| 221 const aura::Window* shadow_underlay_for_test() const { | 228 const aura::Window* shadow_underlay_for_test() const { |
| 222 return shadow_underlay_; | 229 return shadow_underlay_; |
| 223 } | 230 } |
| 224 | 231 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 int pending_resize_component_ = HTCAPTION; | 298 int pending_resize_component_ = HTCAPTION; |
| 292 aura::Window* shadow_overlay_ = nullptr; | 299 aura::Window* shadow_overlay_ = nullptr; |
| 293 aura::Window* shadow_underlay_ = nullptr; | 300 aura::Window* shadow_underlay_ = nullptr; |
| 294 gfx::Rect shadow_content_bounds_; | 301 gfx::Rect shadow_content_bounds_; |
| 295 std::deque<Config> pending_configs_; | 302 std::deque<Config> pending_configs_; |
| 296 std::unique_ptr<ash::WindowResizer> resizer_; | 303 std::unique_ptr<ash::WindowResizer> resizer_; |
| 297 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; | 304 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; |
| 298 int top_inset_height_ = 0; | 305 int top_inset_height_ = 0; |
| 299 int pending_top_inset_height_ = 0; | 306 int pending_top_inset_height_ = 0; |
| 300 float rectangular_shadow_background_opacity_ = 1.0; | 307 float rectangular_shadow_background_opacity_ = 1.0; |
| 308 bool audio_feedback_ = false; | |
|
reveman
2016/09/28 16:11:51
Does this state need to be cached here? Can we jus
erosky
2016/09/28 19:21:13
Done.
| |
| 301 | 309 |
| 302 DISALLOW_COPY_AND_ASSIGN(ShellSurface); | 310 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
| 303 }; | 311 }; |
| 304 | 312 |
| 305 } // namespace exo | 313 } // namespace exo |
| 306 | 314 |
| 307 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ | 315 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
| OLD | NEW |