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> |
| (...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 // [Deprecated] Set the content bounds for the shadow. Shell surface |
| 151 void SetRectangularShadow(bool enabled); | 151 // geometry will be used if bounds are empty. Setting empty bounds |
| 152 // will disable the shadow. | |
| 153 void SetRectangularShadow_DEPRECATED(const gfx::Rect& content_bounds); | |
|
reveman
2017/02/03 17:47:01
Remove _DEPRECATED here. See my comment in server.
| |
| 152 | 154 |
| 153 // Set the content bounds for the shadow. Shell surface geometry will be | 155 // Set the content bounds for the shadow. Shell surface geometry will be |
| 154 // used if bounds are empty. | 156 // used if bounds are empty. Setting empty bounds will disable the shadow. |
| 155 void SetRectangularShadowContentBounds(const gfx::Rect& content_bounds); | 157 // Setting empty bounds will disable the shadow. |
| 158 void SetRectangularSurfaceShadow(const gfx::Rect& content_bounds); | |
| 156 | 159 |
| 157 // Set the pacity of the background for the window that has a shadow. | 160 // Set the pacity of the background for the window that has a shadow. |
| 158 void SetRectangularShadowBackgroundOpacity(float opacity); | 161 void SetRectangularShadowBackgroundOpacity(float opacity); |
| 159 | 162 |
| 160 // Enable/disable window frame. | 163 // Enable/disable window frame. |
| 161 void SetFrame(bool enabled); | 164 void SetFrame(bool enabled); |
| 162 | 165 |
| 163 // Set scale factor for surface. The scale factor will be applied to surface | 166 // Set scale factor for surface. The scale factor will be applied to surface |
| 164 // and all descendants. | 167 // and all descendants. |
| 165 void SetScale(double scale); | 168 void SetScale(double scale); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 // Overridden from ui::EventHandler: | 237 // Overridden from ui::EventHandler: |
| 235 void OnKeyEvent(ui::KeyEvent* event) override; | 238 void OnKeyEvent(ui::KeyEvent* event) override; |
| 236 void OnMouseEvent(ui::MouseEvent* event) override; | 239 void OnMouseEvent(ui::MouseEvent* event) override; |
| 237 | 240 |
| 238 // Overridden from ui::AcceleratorTarget: | 241 // Overridden from ui::AcceleratorTarget: |
| 239 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 242 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 240 | 243 |
| 241 aura::Window* shadow_overlay() { return shadow_overlay_; } | 244 aura::Window* shadow_overlay() { return shadow_overlay_; } |
| 242 aura::Window* shadow_underlay() { return shadow_underlay_; } | 245 aura::Window* shadow_underlay() { return shadow_underlay_; } |
| 243 | 246 |
| 247 void set_shadow_enabled(bool enabled) { shadow_enabled_ = enabled; } | |
|
reveman
2017/02/03 17:47:01
Remove this. See my comment in server.cc.
| |
| 248 | |
| 244 private: | 249 private: |
| 245 class ScopedConfigure; | 250 class ScopedConfigure; |
| 246 class ScopedAnimationsDisabled; | 251 class ScopedAnimationsDisabled; |
| 247 | 252 |
| 248 // Surface state associated with each configure request. | 253 // Surface state associated with each configure request. |
| 249 struct Config { | 254 struct Config { |
| 250 uint32_t serial; | 255 uint32_t serial; |
| 251 gfx::Vector2d origin_offset; | 256 gfx::Vector2d origin_offset; |
| 252 int resize_component; | 257 int resize_component; |
| 253 }; | 258 }; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 aura::Window* shadow_overlay_ = nullptr; | 319 aura::Window* shadow_overlay_ = nullptr; |
| 315 aura::Window* shadow_underlay_ = nullptr; | 320 aura::Window* shadow_underlay_ = nullptr; |
| 316 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_; | 321 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_; |
| 317 gfx::Rect shadow_content_bounds_; | 322 gfx::Rect shadow_content_bounds_; |
| 318 float shadow_background_opacity_ = 1.0; | 323 float shadow_background_opacity_ = 1.0; |
| 319 std::deque<Config> pending_configs_; | 324 std::deque<Config> pending_configs_; |
| 320 std::unique_ptr<ash::WindowResizer> resizer_; | 325 std::unique_ptr<ash::WindowResizer> resizer_; |
| 321 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; | 326 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; |
| 322 int top_inset_height_ = 0; | 327 int top_inset_height_ = 0; |
| 323 int pending_top_inset_height_ = 0; | 328 int pending_top_inset_height_ = 0; |
| 329 // TODO(oshima): Remove this once NYC migration is complete. | |
|
reveman
2017/02/03 17:47:01
I think we still need this for non arc clients. Pl
| |
| 330 bool shadow_underlay_in_shell_surface_ = true; | |
| 324 | 331 |
| 325 DISALLOW_COPY_AND_ASSIGN(ShellSurface); | 332 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
| 326 }; | 333 }; |
| 327 | 334 |
| 328 } // namespace exo | 335 } // namespace exo |
| 329 | 336 |
| 330 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ | 337 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
| OLD | NEW |