| 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> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 void Resize(int component); | 140 void Resize(int component); |
| 141 | 141 |
| 142 // Signal a request to close the window. It is up to the implementation to | 142 // Signal a request to close the window. It is up to the implementation to |
| 143 // actually decide to do so though. | 143 // actually decide to do so though. |
| 144 void Close(); | 144 void Close(); |
| 145 | 145 |
| 146 // Set geometry for surface. The geometry represents the "visible bounds" | 146 // Set geometry for surface. The geometry represents the "visible bounds" |
| 147 // for the surface from the user's perspective. | 147 // for the surface from the user's perspective. |
| 148 void SetGeometry(const gfx::Rect& geometry); | 148 void SetGeometry(const gfx::Rect& geometry); |
| 149 | 149 |
| 150 // Enable/disable rectangular shadow. | 150 // Enable/disable rectangular shadow that uses the widget bounds as a content |
| 151 void SetRectangularShadow(bool enabled); | 151 // bounds. |
| 152 void SetRectangularShadowEnabled(bool enabled); |
| 152 | 153 |
| 153 // Set the content bounds for the shadow. Shell surface geometry will be | 154 // [Deprecated] Set the content bounds for the shadow. Shell surface geometry |
| 155 // will be |
| 154 // used if bounds are empty. | 156 // used if bounds are empty. |
| 155 void SetRectangularShadowContentBounds(const gfx::Rect& content_bounds); | 157 void SetRectangularShadow_DEPRECATED(const gfx::Rect& content_bounds); |
| 158 |
| 159 // Set the content bounds for the shadow in the surface's coordinates. |
| 160 // Setting empty bounds will disable the shadow. |
| 161 void SetRectangularSurfaceShadow(const gfx::Rect& content_bounds); |
| 156 | 162 |
| 157 // Set the pacity of the background for the window that has a shadow. | 163 // Set the pacity of the background for the window that has a shadow. |
| 158 void SetRectangularShadowBackgroundOpacity(float opacity); | 164 void SetRectangularShadowBackgroundOpacity(float opacity); |
| 159 | 165 |
| 160 // Enable/disable window frame. | 166 // Enable/disable window frame. |
| 161 void SetFrame(bool enabled); | 167 void SetFrame(bool enabled); |
| 162 | 168 |
| 163 // Set scale factor for surface. The scale factor will be applied to surface | 169 // Set scale factor for surface. The scale factor will be applied to surface |
| 164 // and all descendants. | 170 // and all descendants. |
| 165 void SetScale(double scale); | 171 void SetScale(double scale); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // Overridden from WMHelper::AccessibilityObserver: | 237 // Overridden from WMHelper::AccessibilityObserver: |
| 232 void OnAccessibilityModeChanged() override; | 238 void OnAccessibilityModeChanged() override; |
| 233 | 239 |
| 234 // Overridden from ui::EventHandler: | 240 // Overridden from ui::EventHandler: |
| 235 void OnKeyEvent(ui::KeyEvent* event) override; | 241 void OnKeyEvent(ui::KeyEvent* event) override; |
| 236 void OnMouseEvent(ui::MouseEvent* event) override; | 242 void OnMouseEvent(ui::MouseEvent* event) override; |
| 237 | 243 |
| 238 // Overridden from ui::AcceleratorTarget: | 244 // Overridden from ui::AcceleratorTarget: |
| 239 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 245 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 240 | 246 |
| 247 aura::Window* shadow_overlay() { return shadow_overlay_; } |
| 241 aura::Window* shadow_underlay() { return shadow_underlay_; } | 248 aura::Window* shadow_underlay() { return shadow_underlay_; } |
| 242 | 249 |
| 250 Surface* surface_for_testing() { return surface_; } |
| 251 |
| 243 private: | 252 private: |
| 244 class ScopedConfigure; | 253 class ScopedConfigure; |
| 245 class ScopedAnimationsDisabled; | 254 class ScopedAnimationsDisabled; |
| 246 | 255 |
| 247 // Surface state associated with each configure request. | 256 // Surface state associated with each configure request. |
| 248 struct Config { | 257 struct Config { |
| 249 uint32_t serial; | 258 uint32_t serial; |
| 250 gfx::Vector2d origin_offset; | 259 gfx::Vector2d origin_offset; |
| 251 int resize_component; | 260 int resize_component; |
| 252 }; | 261 }; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 aura::Window* shadow_overlay_ = nullptr; | 322 aura::Window* shadow_overlay_ = nullptr; |
| 314 aura::Window* shadow_underlay_ = nullptr; | 323 aura::Window* shadow_underlay_ = nullptr; |
| 315 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_; | 324 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_; |
| 316 gfx::Rect shadow_content_bounds_; | 325 gfx::Rect shadow_content_bounds_; |
| 317 float shadow_background_opacity_ = 1.0; | 326 float shadow_background_opacity_ = 1.0; |
| 318 std::deque<Config> pending_configs_; | 327 std::deque<Config> pending_configs_; |
| 319 std::unique_ptr<ash::WindowResizer> resizer_; | 328 std::unique_ptr<ash::WindowResizer> resizer_; |
| 320 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; | 329 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; |
| 321 int top_inset_height_ = 0; | 330 int top_inset_height_ = 0; |
| 322 int pending_top_inset_height_ = 0; | 331 int pending_top_inset_height_ = 0; |
| 332 bool shadow_underlay_in_surface_ = true; |
| 323 | 333 |
| 324 DISALLOW_COPY_AND_ASSIGN(ShellSurface); | 334 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
| 325 }; | 335 }; |
| 326 | 336 |
| 327 } // namespace exo | 337 } // namespace exo |
| 328 | 338 |
| 329 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ | 339 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
| OLD | NEW |