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

Unified Diff: components/exo/shell_surface.h

Issue 2396883003: exo: Fix dragging edge cases (Closed)
Patch Set: Fix presubmit errors Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/exo/shell_surface.h
diff --git a/components/exo/shell_surface.h b/components/exo/shell_surface.h
index 3fd85d57eb35dbd3a04d8a48d3b4bcd494b7f8e0..81d26d0d9168b855cab86e1930e4d9613714b9ec 100644
--- a/components/exo/shell_surface.h
+++ b/components/exo/shell_surface.h
@@ -33,6 +33,7 @@ class TracedValue;
}
namespace exo {
+class Display;
class Surface;
// This class provides functions for treating a surfaces like toplevel,
@@ -45,14 +46,16 @@ class ShellSurface : public SurfaceDelegate,
public ash::wm::WindowStateObserver,
public aura::WindowObserver,
public WMHelper::ActivationObserver,
+ public WMHelper::ShellObserver,
public WMHelper::AccessibilityObserver {
public:
- ShellSurface(Surface* surface,
+ ShellSurface(const Display& display,
+ Surface* surface,
ShellSurface* parent,
const gfx::Rect& initial_bounds,
bool activatable,
int container);
- explicit ShellSurface(Surface* surface);
+ ShellSurface(const Display& display, Surface* surface);
~ShellSurface() override;
// Set the callback to run when the user wants the shell surface to be closed.
@@ -110,6 +113,10 @@ class ShellSurface : public SurfaceDelegate,
// Restore the shell surface.
void Restore();
+ // Start and stop a client-driven move of the shell surface.
+ void SetMoving();
+ void UnsetMoving(bool revert);
+
// Set fullscreen state for shell surface.
void SetFullscreen(bool fullscreen);
@@ -212,6 +219,10 @@ class ShellSurface : public SurfaceDelegate,
aura::Window* gained_active,
aura::Window* lost_active) override;
+ // Overridden from WMHelper::ShellObserver:
+ void OnOverviewModeStarted() override;
+ void OnOverviewModeEnded() override;
+
// Overridden from WMHelper::AccessibilityObserver:
void OnAccessibilityModeChanged() override;
@@ -249,6 +260,9 @@ class ShellSurface : public SurfaceDelegate,
// End current drag operation.
void EndDrag(bool revert);
+ // End current drag or client-driven move.
+ void EndDragOrMove(bool revert);
+
// Returns true if surface is currently being resized.
bool IsResizing() const;
@@ -262,10 +276,17 @@ class ShellSurface : public SurfaceDelegate,
// Updates the bounds of widget to match the current surface bounds.
void UpdateWidgetBounds();
+ // Updates the bounds of surface to match the current widget bounds.
+ void UpdateSurfaceBounds();
+
// Creates, deletes and update the shadow bounds based on
// |pending_shadow_content_bounds_|.
void UpdateShadow();
+ // In the coordinate system of the parent root window.
+ gfx::Point GetMouseLocation() const;
+
+ const Display& display_;
views::Widget* widget_ = nullptr;
Surface* surface_;
aura::Window* parent_;
@@ -285,6 +306,7 @@ class ShellSurface : public SurfaceDelegate,
StateChangedCallback state_changed_callback_;
ConfigureCallback configure_callback_;
ScopedConfigure* scoped_configure_ = nullptr;
+ bool ignore_widget_bounds_changes_ = false;
bool ignore_window_bounds_changes_ = false;
gfx::Point origin_;
gfx::Vector2d pending_origin_offset_;
@@ -297,6 +319,7 @@ class ShellSurface : public SurfaceDelegate,
gfx::Rect shadow_content_bounds_;
std::deque<Config> pending_configs_;
std::unique_ptr<ash::WindowResizer> resizer_;
+ std::unique_ptr<ash::WindowResizer> move_resizer_;
std::unique_ptr<ScopedAnimationsDisabled> scoped_animations_disabled_;
int top_inset_height_ = 0;
int pending_top_inset_height_ = 0;

Powered by Google App Engine
This is Rietveld 408576698