| 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 <cstdint> | 8 #include <cstdint> |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // This class provides functions for treating a surfaces like toplevel, | 42 // This class provides functions for treating a surfaces like toplevel, |
| 43 // fullscreen or popup widgets, move, resize or maximize them, associate | 43 // fullscreen or popup widgets, move, resize or maximize them, associate |
| 44 // metadata like title and class, etc. | 44 // metadata like title and class, etc. |
| 45 class ShellSurface : public SurfaceDelegate, | 45 class ShellSurface : public SurfaceDelegate, |
| 46 public SurfaceObserver, | 46 public SurfaceObserver, |
| 47 public views::WidgetDelegate, | 47 public views::WidgetDelegate, |
| 48 public views::View, | 48 public views::View, |
| 49 public ash::wm::WindowStateObserver, | 49 public ash::wm::WindowStateObserver, |
| 50 public aura::WindowObserver, | 50 public aura::WindowObserver, |
| 51 public WMHelper::ActivationObserver, | 51 public WMHelper::ActivationObserver, |
| 52 public WMHelper::AccessibilityObserver, | |
| 53 public WMHelper::DisplayConfigurationObserver { | 52 public WMHelper::DisplayConfigurationObserver { |
| 54 public: | 53 public: |
| 55 enum class BoundsMode { SHELL, CLIENT, FIXED }; | 54 enum class BoundsMode { SHELL, CLIENT, FIXED }; |
| 56 | 55 |
| 57 // The |origin| is in screen coordinates. When bounds are controlled by the | 56 // The |origin| is in screen coordinates. When bounds are controlled by the |
| 58 // shell or fixed, it determines the initial position of the shell surface. | 57 // shell or fixed, it determines the initial position of the shell surface. |
| 59 // In that case, the position specified as part of the geometry is relative | 58 // In that case, the position specified as part of the geometry is relative |
| 60 // to the shell surface. | 59 // to the shell surface. |
| 61 // | 60 // |
| 62 // When bounds are controlled by the client, it represents the origin of a | 61 // When bounds are controlled by the client, it represents the origin of a |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 void OnWindowBoundsChanged(aura::Window* window, | 255 void OnWindowBoundsChanged(aura::Window* window, |
| 257 const gfx::Rect& old_bounds, | 256 const gfx::Rect& old_bounds, |
| 258 const gfx::Rect& new_bounds) override; | 257 const gfx::Rect& new_bounds) override; |
| 259 void OnWindowDestroying(aura::Window* window) override; | 258 void OnWindowDestroying(aura::Window* window) override; |
| 260 | 259 |
| 261 // Overridden from WMHelper::ActivationObserver: | 260 // Overridden from WMHelper::ActivationObserver: |
| 262 void OnWindowActivated( | 261 void OnWindowActivated( |
| 263 aura::Window* gained_active, | 262 aura::Window* gained_active, |
| 264 aura::Window* lost_active) override; | 263 aura::Window* lost_active) override; |
| 265 | 264 |
| 266 // Overridden from WMHelper::AccessibilityObserver: | |
| 267 void OnAccessibilityModeChanged() override; | |
| 268 | |
| 269 // Overridden from WMHelper::DisplayConfigurationObserver: | 265 // Overridden from WMHelper::DisplayConfigurationObserver: |
| 270 void OnDisplayConfigurationChanged() override; | 266 void OnDisplayConfigurationChanged() override; |
| 271 | 267 |
| 272 // Overridden from ui::EventHandler: | 268 // Overridden from ui::EventHandler: |
| 273 void OnKeyEvent(ui::KeyEvent* event) override; | 269 void OnKeyEvent(ui::KeyEvent* event) override; |
| 274 void OnMouseEvent(ui::MouseEvent* event) override; | 270 void OnMouseEvent(ui::MouseEvent* event) override; |
| 275 | 271 |
| 276 // Overridden from ui::AcceleratorTarget: | 272 // Overridden from ui::AcceleratorTarget: |
| 277 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 273 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 278 | 274 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 ConfigureCallback configure_callback_; | 356 ConfigureCallback configure_callback_; |
| 361 ScopedConfigure* scoped_configure_ = nullptr; | 357 ScopedConfigure* scoped_configure_ = nullptr; |
| 362 bool ignore_window_bounds_changes_ = false; | 358 bool ignore_window_bounds_changes_ = false; |
| 363 gfx::Vector2d origin_offset_; | 359 gfx::Vector2d origin_offset_; |
| 364 gfx::Vector2d pending_origin_offset_; | 360 gfx::Vector2d pending_origin_offset_; |
| 365 gfx::Vector2d pending_origin_offset_accumulator_; | 361 gfx::Vector2d pending_origin_offset_accumulator_; |
| 366 int resize_component_ = HTCAPTION; // HT constant (see ui/base/hit_test.h) | 362 int resize_component_ = HTCAPTION; // HT constant (see ui/base/hit_test.h) |
| 367 int pending_resize_component_ = HTCAPTION; | 363 int pending_resize_component_ = HTCAPTION; |
| 368 std::unique_ptr<aura::Window> shadow_overlay_; | 364 std::unique_ptr<aura::Window> shadow_overlay_; |
| 369 std::unique_ptr<aura::Window> shadow_underlay_; | 365 std::unique_ptr<aura::Window> shadow_underlay_; |
| 370 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_; | |
| 371 gfx::Rect shadow_content_bounds_; | 366 gfx::Rect shadow_content_bounds_; |
| 372 float shadow_background_opacity_ = 1.0; | 367 float shadow_background_opacity_ = 1.0; |
| 373 std::deque<Config> pending_configs_; | 368 std::deque<Config> pending_configs_; |
| 374 std::unique_ptr<ash::WindowResizer> resizer_; | 369 std::unique_ptr<ash::WindowResizer> resizer_; |
| 375 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; | 370 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; |
| 376 int top_inset_height_ = 0; | 371 int top_inset_height_ = 0; |
| 377 int pending_top_inset_height_ = 0; | 372 int pending_top_inset_height_ = 0; |
| 378 bool shadow_underlay_in_surface_ = true; | 373 bool shadow_underlay_in_surface_ = true; |
| 379 bool pending_shadow_underlay_in_surface_ = true; | 374 bool pending_shadow_underlay_in_surface_ = true; |
| 380 bool system_modal_ = false; | 375 bool system_modal_ = false; |
| 381 | 376 |
| 382 DISALLOW_COPY_AND_ASSIGN(ShellSurface); | 377 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
| 383 }; | 378 }; |
| 384 | 379 |
| 385 } // namespace exo | 380 } // namespace exo |
| 386 | 381 |
| 387 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ | 382 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
| OLD | NEW |