Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Side by Side Diff: components/exo/shell_surface.h

Issue 2664403004: Use pixel coordinates for shadow underlay bounds (Closed)
Patch Set: addressed comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/exo/shell_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
241 aura::Window* shadow_overlay() { return shadow_overlay_; } 247 aura::Window* shadow_overlay() { return shadow_overlay_; }
242 aura::Window* shadow_underlay() { return shadow_underlay_; } 248 aura::Window* shadow_underlay() { return shadow_underlay_; }
243 249
250 Surface* surface_for_testing() { return surface_; }
251
244 private: 252 private:
245 class ScopedConfigure; 253 class ScopedConfigure;
246 class ScopedAnimationsDisabled; 254 class ScopedAnimationsDisabled;
247 255
248 // Surface state associated with each configure request. 256 // Surface state associated with each configure request.
249 struct Config { 257 struct Config {
250 uint32_t serial; 258 uint32_t serial;
251 gfx::Vector2d origin_offset; 259 gfx::Vector2d origin_offset;
252 int resize_component; 260 int resize_component;
253 }; 261 };
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 aura::Window* shadow_overlay_ = nullptr; 322 aura::Window* shadow_overlay_ = nullptr;
315 aura::Window* shadow_underlay_ = nullptr; 323 aura::Window* shadow_underlay_ = nullptr;
316 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_; 324 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_;
317 gfx::Rect shadow_content_bounds_; 325 gfx::Rect shadow_content_bounds_;
318 float shadow_background_opacity_ = 1.0; 326 float shadow_background_opacity_ = 1.0;
319 std::deque<Config> pending_configs_; 327 std::deque<Config> pending_configs_;
320 std::unique_ptr<ash::WindowResizer> resizer_; 328 std::unique_ptr<ash::WindowResizer> resizer_;
321 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; 329 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_;
322 int top_inset_height_ = 0; 330 int top_inset_height_ = 0;
323 int pending_top_inset_height_ = 0; 331 int pending_top_inset_height_ = 0;
332 bool shadow_underlay_in_surface_ = true;
324 333
325 DISALLOW_COPY_AND_ASSIGN(ShellSurface); 334 DISALLOW_COPY_AND_ASSIGN(ShellSurface);
326 }; 335 };
327 336
328 } // namespace exo 337 } // namespace exo
329 338
330 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ 339 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_
OLDNEW
« no previous file with comments | « no previous file | components/exo/shell_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698