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

Unified Diff: ui/aura/mus/window_tree_client.h

Issue 2468493002: Fix bug in keeping capture in sync during destruction (Closed)
Patch Set: feedback Created 4 years, 1 month 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 | « ui/aura/mus/in_flight_change.cc ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client.h
diff --git a/ui/aura/mus/window_tree_client.h b/ui/aura/mus/window_tree_client.h
index 225e1168ea0621bf52aa57aab6dd9758c07791c3..b3e4a86d87879bfef8e6bebfd5c884899cea3728 100644
--- a/ui/aura/mus/window_tree_client.h
+++ b/ui/aura/mus/window_tree_client.h
@@ -22,9 +22,9 @@
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/ui/public/interfaces/window_tree.mojom.h"
#include "ui/aura/aura_export.h"
-#include "ui/aura/client/capture_client_observer.h"
#include "ui/aura/client/focus_change_observer.h"
#include "ui/aura/client/transient_window_client_observer.h"
+#include "ui/aura/mus/capture_synchronizer_delegate.h"
#include "ui/aura/mus/drag_drop_controller_host.h"
#include "ui/aura/mus/mus_types.h"
#include "ui/aura/mus/window_manager_delegate.h"
@@ -43,9 +43,9 @@ class Connector;
}
namespace aura {
+class CaptureSynchronizer;
class DragDropControllerMus;
class InFlightBoundsChange;
-class InFlightCaptureChange;
class InFlightChange;
class InFlightFocusChange;
class InFlightPropertyChange;
@@ -76,10 +76,10 @@ using EventResultCallback = base::Callback<void(ui::mojom::EventResult)>;
class AURA_EXPORT WindowTreeClient
: NON_EXPORTED_BASE(public ui::mojom::WindowTreeClient),
NON_EXPORTED_BASE(public ui::mojom::WindowManager),
+ public CaptureSynchronizerDelegate,
public DragDropControllerHost,
public WindowManagerClient,
public WindowTreeHostMusDelegate,
- public client::CaptureClientObserver,
public client::FocusChangeObserver,
public client::TransientWindowClientObserver {
public:
@@ -138,10 +138,6 @@ class AURA_EXPORT WindowTreeClient
// Returns the root of this connection.
std::set<Window*> GetRoots();
- // Returns the Window with input capture; null if no window has requested
- // input capture, or if another app has capture.
- Window* GetCaptureWindow();
-
// Returns the focused window; null if focus is not yet known or another app
// is focused.
Window* GetFocusedWindow();
@@ -172,7 +168,6 @@ class AURA_EXPORT WindowTreeClient
private:
friend class InFlightBoundsChange;
- friend class InFlightCaptureChange;
friend class InFlightFocusChange;
friend class InFlightPropertyChange;
friend class InFlightVisibleChange;
@@ -195,8 +190,6 @@ class AURA_EXPORT WindowTreeClient
void SetFocusFromServerImpl(client::FocusClient* focus_client,
WindowMus* window);
- void SetCaptureFromServer(WindowMus* window);
-
// Returns the oldest InFlightChange that matches |change|.
InFlightChange* GetOldestInFlightChangeMatching(const InFlightChange& change);
@@ -240,6 +233,9 @@ class AURA_EXPORT WindowTreeClient
// Sets the ui::mojom::WindowTree implementation.
void SetWindowTree(ui::mojom::WindowTreePtr window_tree_ptr);
+ // Called when the connection to the server is established.
+ void WindowTreeConnectionEstablished(ui::mojom::WindowTree* window_tree);
+
// Called when the ui::mojom::WindowTree connection is lost, deletes this.
void OnConnectionLost();
@@ -430,9 +426,6 @@ class AURA_EXPORT WindowTreeClient
// Overriden from client::FocusChangeObserver:
void OnWindowFocused(Window* gained_focus, Window* lost_focus) override;
- // Overriden from client::CaptureClientObserver:
- void OnCaptureChanged(Window* lost_capture, Window* gained_capture) override;
-
// Overriden from WindowTreeHostMusDelegate:
void SetRootWindowBounds(Window* window, gfx::Rect* bounds) override;
@@ -445,6 +438,9 @@ class AURA_EXPORT WindowTreeClient
// Overriden from DragDropControllerHost:
uint32_t CreateChangeIdForDrag(WindowMus* window) override;
+ // Overrided from CaptureSynchronizerDelegate:
+ uint32_t CreateChangeIdForCapture(WindowMus* window) override;
+
// The one int in |cursor_location_mapping_|. When we read from this
// location, we must always read from it atomically.
base::subtle::Atomic32* cursor_location_memory() {
@@ -472,9 +468,7 @@ class AURA_EXPORT WindowTreeClient
IdToWindowMap windows_;
std::map<ClientSpecificId, std::set<Window*>> embedded_windows_;
- bool setting_capture_ = false;
- WindowMus* window_setting_capture_to_ = nullptr;
- WindowMus* capture_window_ = nullptr;
+ std::unique_ptr<CaptureSynchronizer> capture_synchronizer_;
bool setting_focus_ = false;
WindowMus* window_setting_focus_to_ = nullptr;
« no previous file with comments | « ui/aura/mus/in_flight_change.cc ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698