| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 // Overridden from WMHelper::DisplayConfigurationObserver: | 269 // Overridden from WMHelper::DisplayConfigurationObserver: |
| 270 void OnDisplayConfigurationChanged() override; | 270 void OnDisplayConfigurationChanged() override; |
| 271 | 271 |
| 272 // Overridden from ui::EventHandler: | 272 // Overridden from ui::EventHandler: |
| 273 void OnKeyEvent(ui::KeyEvent* event) override; | 273 void OnKeyEvent(ui::KeyEvent* event) override; |
| 274 void OnMouseEvent(ui::MouseEvent* event) override; | 274 void OnMouseEvent(ui::MouseEvent* event) override; |
| 275 | 275 |
| 276 // Overridden from ui::AcceleratorTarget: | 276 // Overridden from ui::AcceleratorTarget: |
| 277 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 277 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 278 | 278 |
| 279 aura::Window* shadow_overlay() { return shadow_overlay_; } | 279 aura::Window* shadow_overlay() { return shadow_overlay_.get(); } |
| 280 aura::Window* shadow_underlay() { return shadow_underlay_; } | 280 aura::Window* shadow_underlay() { return shadow_underlay_.get(); } |
| 281 | 281 |
| 282 Surface* surface_for_testing() { return surface_; } | 282 Surface* surface_for_testing() { return surface_; } |
| 283 | 283 |
| 284 private: | 284 private: |
| 285 class ScopedConfigure; | 285 class ScopedConfigure; |
| 286 class ScopedAnimationsDisabled; | 286 class ScopedAnimationsDisabled; |
| 287 | 287 |
| 288 // Surface state associated with each configure request. | 288 // Surface state associated with each configure request. |
| 289 struct Config { | 289 struct Config { |
| 290 uint32_t serial; | 290 uint32_t serial; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 // Creates, deletes and update the shadow bounds based on | 328 // Creates, deletes and update the shadow bounds based on |
| 329 // |pending_shadow_content_bounds_|. | 329 // |pending_shadow_content_bounds_|. |
| 330 void UpdateShadow(); | 330 void UpdateShadow(); |
| 331 | 331 |
| 332 // Applies |system_modal_| to |widget_|. | 332 // Applies |system_modal_| to |widget_|. |
| 333 void UpdateSystemModal(); | 333 void UpdateSystemModal(); |
| 334 | 334 |
| 335 // In the coordinate system of the parent root window. | 335 // In the coordinate system of the parent root window. |
| 336 gfx::Point GetMouseLocation() const; | 336 gfx::Point GetMouseLocation() const; |
| 337 | 337 |
| 338 void ResetShadowWindows(); |
| 339 |
| 338 views::Widget* widget_ = nullptr; | 340 views::Widget* widget_ = nullptr; |
| 339 Surface* surface_; | 341 Surface* surface_; |
| 340 aura::Window* parent_; | 342 aura::Window* parent_; |
| 341 const BoundsMode bounds_mode_; | 343 const BoundsMode bounds_mode_; |
| 342 int64_t primary_display_id_; | 344 int64_t primary_display_id_; |
| 343 gfx::Point origin_; | 345 gfx::Point origin_; |
| 344 bool activatable_ = true; | 346 bool activatable_ = true; |
| 345 const bool can_minimize_; | 347 const bool can_minimize_; |
| 346 // Container Window Id (see ash/public/cpp/shell_window_ids.h) | 348 // Container Window Id (see ash/public/cpp/shell_window_ids.h) |
| 347 int container_; | 349 int container_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 358 base::Closure surface_destroyed_callback_; | 360 base::Closure surface_destroyed_callback_; |
| 359 StateChangedCallback state_changed_callback_; | 361 StateChangedCallback state_changed_callback_; |
| 360 ConfigureCallback configure_callback_; | 362 ConfigureCallback configure_callback_; |
| 361 ScopedConfigure* scoped_configure_ = nullptr; | 363 ScopedConfigure* scoped_configure_ = nullptr; |
| 362 bool ignore_window_bounds_changes_ = false; | 364 bool ignore_window_bounds_changes_ = false; |
| 363 gfx::Vector2d origin_offset_; | 365 gfx::Vector2d origin_offset_; |
| 364 gfx::Vector2d pending_origin_offset_; | 366 gfx::Vector2d pending_origin_offset_; |
| 365 gfx::Vector2d pending_origin_offset_accumulator_; | 367 gfx::Vector2d pending_origin_offset_accumulator_; |
| 366 int resize_component_ = HTCAPTION; // HT constant (see ui/base/hit_test.h) | 368 int resize_component_ = HTCAPTION; // HT constant (see ui/base/hit_test.h) |
| 367 int pending_resize_component_ = HTCAPTION; | 369 int pending_resize_component_ = HTCAPTION; |
| 368 aura::Window* shadow_overlay_ = nullptr; | 370 std::unique_ptr<aura::Window> shadow_overlay_; |
| 369 aura::Window* shadow_underlay_ = nullptr; | 371 std::unique_ptr<aura::Window> shadow_underlay_; |
| 370 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_; | 372 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_; |
| 371 gfx::Rect shadow_content_bounds_; | 373 gfx::Rect shadow_content_bounds_; |
| 372 float shadow_background_opacity_ = 1.0; | 374 float shadow_background_opacity_ = 1.0; |
| 373 std::deque<Config> pending_configs_; | 375 std::deque<Config> pending_configs_; |
| 374 std::unique_ptr<ash::WindowResizer> resizer_; | 376 std::unique_ptr<ash::WindowResizer> resizer_; |
| 375 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; | 377 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; |
| 376 int top_inset_height_ = 0; | 378 int top_inset_height_ = 0; |
| 377 int pending_top_inset_height_ = 0; | 379 int pending_top_inset_height_ = 0; |
| 378 bool shadow_underlay_in_surface_ = true; | 380 bool shadow_underlay_in_surface_ = true; |
| 379 bool system_modal_ = false; | 381 bool system_modal_ = false; |
| 380 | 382 |
| 381 DISALLOW_COPY_AND_ASSIGN(ShellSurface); | 383 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
| 382 }; | 384 }; |
| 383 | 385 |
| 384 } // namespace exo | 386 } // namespace exo |
| 385 | 387 |
| 386 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ | 388 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
| OLD | NEW |