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

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

Issue 2396883003: exo: Fix dragging edge cases (Closed)
Patch Set: Rebase Created 3 years, 11 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
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 28 matching lines...) Expand all
39 // This class provides functions for treating a surfaces like toplevel, 39 // This class provides functions for treating a surfaces like toplevel,
40 // fullscreen or popup widgets, move, resize or maximize them, associate 40 // fullscreen or popup widgets, move, resize or maximize them, associate
41 // metadata like title and class, etc. 41 // metadata like title and class, etc.
42 class ShellSurface : public SurfaceDelegate, 42 class ShellSurface : public SurfaceDelegate,
43 public SurfaceObserver, 43 public SurfaceObserver,
44 public views::WidgetDelegate, 44 public views::WidgetDelegate,
45 public views::View, 45 public views::View,
46 public ash::wm::WindowStateObserver, 46 public ash::wm::WindowStateObserver,
47 public aura::WindowObserver, 47 public aura::WindowObserver,
48 public WMHelper::ActivationObserver, 48 public WMHelper::ActivationObserver,
49 public WMHelper::ShellObserver,
49 public WMHelper::AccessibilityObserver { 50 public WMHelper::AccessibilityObserver {
50 public: 51 public:
51 // The initial bounds are relative to the coordinate system from/to which the 52 // The initial bounds are relative to the coordinate system from/to which the
52 // screen transforms map. 53 // screen transforms map.
53 ShellSurface(Surface* surface, 54 ShellSurface(Surface* surface,
54 ShellSurface* parent, 55 ShellSurface* parent,
55 const gfx::Rect& initial_bounds, 56 const gfx::Rect& initial_bounds,
56 ScreenTransform transform_to_screen, 57 ScreenTransform transform_to_screen,
57 ScreenTransform transform_from_screen, 58 ScreenTransform transform_from_screen,
58 bool activatable, 59 bool activatable,
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 void OnWindowBoundsChanged(aura::Window* window, 231 void OnWindowBoundsChanged(aura::Window* window,
231 const gfx::Rect& old_bounds, 232 const gfx::Rect& old_bounds,
232 const gfx::Rect& new_bounds) override; 233 const gfx::Rect& new_bounds) override;
233 void OnWindowDestroying(aura::Window* window) override; 234 void OnWindowDestroying(aura::Window* window) override;
234 235
235 // Overridden from WMHelper::ActivationObserver: 236 // Overridden from WMHelper::ActivationObserver:
236 void OnWindowActivated( 237 void OnWindowActivated(
237 aura::Window* gained_active, 238 aura::Window* gained_active,
238 aura::Window* lost_active) override; 239 aura::Window* lost_active) override;
239 240
241 // Overridden from WMHelper::ShellObserver:
242 void OnOverviewModeStarted() override;
243 void OnOverviewModeEnded() override;
244
240 // Overridden from WMHelper::AccessibilityObserver: 245 // Overridden from WMHelper::AccessibilityObserver:
241 void OnAccessibilityModeChanged() override; 246 void OnAccessibilityModeChanged() override;
242 247
243 // Overridden from ui::EventHandler: 248 // Overridden from ui::EventHandler:
244 void OnKeyEvent(ui::KeyEvent* event) override; 249 void OnKeyEvent(ui::KeyEvent* event) override;
245 void OnMouseEvent(ui::MouseEvent* event) override; 250 void OnMouseEvent(ui::MouseEvent* event) override;
246 251
247 // Overridden from ui::AcceleratorTarget: 252 // Overridden from ui::AcceleratorTarget:
248 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; 253 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
249 254
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 std::string application_id_; 322 std::string application_id_;
318 gfx::Rect geometry_; 323 gfx::Rect geometry_;
319 gfx::Rect pending_geometry_; 324 gfx::Rect pending_geometry_;
320 double scale_ = 1.0; 325 double scale_ = 1.0;
321 double pending_scale_ = 1.0; 326 double pending_scale_ = 1.0;
322 base::Closure close_callback_; 327 base::Closure close_callback_;
323 base::Closure surface_destroyed_callback_; 328 base::Closure surface_destroyed_callback_;
324 StateChangedCallback state_changed_callback_; 329 StateChangedCallback state_changed_callback_;
325 ConfigureCallback configure_callback_; 330 ConfigureCallback configure_callback_;
326 ScopedConfigure* scoped_configure_ = nullptr; 331 ScopedConfigure* scoped_configure_ = nullptr;
332 bool ignore_widget_bounds_changes_ = false;
327 bool ignore_window_bounds_changes_ = false; 333 bool ignore_window_bounds_changes_ = false;
328 gfx::Point origin_; 334 gfx::Point origin_;
329 gfx::Vector2d pending_origin_offset_; 335 gfx::Vector2d pending_origin_offset_;
330 gfx::Vector2d pending_origin_config_offset_; 336 gfx::Vector2d pending_origin_config_offset_;
331 int resize_component_ = HTCAPTION; // HT constant (see ui/base/hit_test.h) 337 int resize_component_ = HTCAPTION; // HT constant (see ui/base/hit_test.h)
332 int pending_resize_component_ = HTCAPTION; 338 int pending_resize_component_ = HTCAPTION;
333 aura::Window* shadow_overlay_ = nullptr; 339 aura::Window* shadow_overlay_ = nullptr;
334 aura::Window* shadow_underlay_ = nullptr; 340 aura::Window* shadow_underlay_ = nullptr;
335 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_; 341 std::unique_ptr<ui::EventHandler> shadow_underlay_event_handler_;
336 gfx::Rect shadow_content_bounds_; 342 gfx::Rect shadow_content_bounds_;
337 float shadow_background_opacity_ = 1.0; 343 float shadow_background_opacity_ = 1.0;
338 std::deque<Config> pending_configs_; 344 std::deque<Config> pending_configs_;
339 std::unique_ptr<ash::WindowResizer> resizer_; 345 std::unique_ptr<ash::WindowResizer> resizer_;
340 std::unique_ptr<ash::WindowResizer> move_resizer_; 346 std::unique_ptr<ash::WindowResizer> move_resizer_;
341 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_; 347 std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_;
342 int top_inset_height_ = 0; 348 int top_inset_height_ = 0;
343 int pending_top_inset_height_ = 0; 349 int pending_top_inset_height_ = 0;
344 350
345 DISALLOW_COPY_AND_ASSIGN(ShellSurface); 351 DISALLOW_COPY_AND_ASSIGN(ShellSurface);
346 }; 352 };
347 353
348 } // namespace exo 354 } // namespace exo
349 355
350 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ 356 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698