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

Unified Diff: components/exo/shell_surface.h

Issue 2645663004: exo: Initial support for multiple displays in ARC (Closed)
Patch Set: Fix bad merge in test 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/pointer_unittest.cc ('k') | components/exo/shell_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.h
diff --git a/components/exo/shell_surface.h b/components/exo/shell_surface.h
index 64eeb544606f39454794a180329ca6b2cb689265..089872f2606b7855c2ad6822f52861249ce4ae2c 100644
--- a/components/exo/shell_surface.h
+++ b/components/exo/shell_surface.h
@@ -47,9 +47,21 @@ class ShellSurface : public SurfaceDelegate,
public WMHelper::ActivationObserver,
public WMHelper::AccessibilityObserver {
public:
+ enum class BoundsMode { SHELL, CLIENT, FIXED };
reveman 2017/02/08 22:04:43 Can you start by pulling out the origin and Bounds
Dominik Laskowski 2017/02/09 03:01:35 Done.
+
+ // The |origin| is in screen coordinates. When bounds are controlled by the
+ // shell or fixed, it determines the initial position of the shell surface.
+ // In that case, the position specified as part of the geometry is relative
+ // to the shell surface.
+ //
+ // When bounds are controlled by the client, it represents the origin of a
+ // coordinate system to which the position of the shell surface, specified
+ // as part of the geometry, is relative. The client must acknowledge changes
+ // to the origin, and offset the geometry accordingly.
ShellSurface(Surface* surface,
ShellSurface* parent,
- const gfx::Rect& initial_bounds,
+ BoundsMode bounds_mode,
+ const gfx::Point& origin,
bool activatable,
bool can_minimize,
int container);
@@ -62,6 +74,11 @@ class ShellSurface : public SurfaceDelegate,
close_callback_ = close_callback;
}
+ // Set the callback to run when the shell surface is destroyed.
+ void set_destroyed_callback(const base::Closure& destroyed_callback) {
+ destroyed_callback_ = destroyed_callback;
+ }
+
// Set the callback to run when the surface is destroyed.
void set_surface_destroyed_callback(
const base::Closure& surface_destroyed_callback) {
@@ -85,7 +102,8 @@ class ShellSurface : public SurfaceDelegate,
base::Callback<uint32_t(const gfx::Size& size,
ash::wm::WindowStateType state_type,
bool resizing,
- bool activated)>;
+ bool activated,
+ const gfx::Point& origin)>;
void set_configure_callback(const ConfigureCallback& configure_callback) {
configure_callback_ = configure_callback;
}
@@ -271,8 +289,12 @@ class ShellSurface : public SurfaceDelegate,
// determined by |component|.
void AttemptToStartDrag(int component);
+ // Attempt to start a client-driven drag operation.
+ void AttemptToStartClientDrag();
+
// End current drag operation.
void EndDrag(bool revert);
+ void EndDrag(aura::Window* window, bool revert);
// Returns true if surface is currently being resized.
bool IsResizing() const;
@@ -287,14 +309,21 @@ 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;
+
views::Widget* widget_ = nullptr;
Surface* surface_;
aura::Window* parent_;
- gfx::Rect initial_bounds_;
+ const BoundsMode bounds_mode_;
+ gfx::Point origin_;
bool activatable_ = true;
const bool can_minimize_;
// Container Window Id (see ash/public/cpp/shell_window_ids.h)
@@ -309,14 +338,15 @@ class ShellSurface : public SurfaceDelegate,
double scale_ = 1.0;
double pending_scale_ = 1.0;
base::Closure close_callback_;
+ base::Closure destroyed_callback_;
base::Closure surface_destroyed_callback_;
StateChangedCallback state_changed_callback_;
ConfigureCallback configure_callback_;
ScopedConfigure* scoped_configure_ = nullptr;
bool ignore_window_bounds_changes_ = false;
- gfx::Point origin_;
+ gfx::Vector2d origin_offset_;
gfx::Vector2d pending_origin_offset_;
- gfx::Vector2d pending_origin_config_offset_;
+ gfx::Vector2d pending_origin_offset_accumulator_;
reveman 2017/02/08 22:04:43 I'd like to see these member variable name changes
Dominik Laskowski 2017/02/09 03:01:35 Done.
int resize_component_ = HTCAPTION; // HT constant (see ui/base/hit_test.h)
int pending_resize_component_ = HTCAPTION;
aura::Window* shadow_overlay_ = nullptr;
« no previous file with comments | « components/exo/pointer_unittest.cc ('k') | components/exo/shell_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698