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

Unified Diff: ui/base/x/selection_owner.cc

Issue 2313033002: Refactor X11ForeignWindowManager (Reland) (Closed)
Patch Set: Created 4 years, 3 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: ui/base/x/selection_owner.cc
diff --git a/ui/base/x/selection_owner.cc b/ui/base/x/selection_owner.cc
index af58a3787a58d8548386e4219cee3f83bc5069f5..c211ebf5a5607b81bb11105a2ca20dec5436d8f7 100644
--- a/ui/base/x/selection_owner.cc
+++ b/ui/base/x/selection_owner.cc
@@ -10,8 +10,8 @@
#include "base/logging.h"
#include "ui/base/x/selection_utils.h"
-#include "ui/base/x/x11_foreign_window_manager.h"
#include "ui/base/x/x11_util.h"
+#include "ui/base/x/x11_window_manager.h"
#include "ui/events/platform/x11/x11_event_source.h"
namespace ui {
@@ -269,17 +269,15 @@ bool SelectionOwner::ProcessTarget(XAtom target,
base::TimeTicks timeout =
base::TimeTicks::Now() +
base::TimeDelta::FromMilliseconds(kIncrementalTransferTimeoutMs);
- int foreign_window_manager_id =
- ui::XForeignWindowManager::GetInstance()->RequestEvents(
- requestor, PropertyChangeMask);
+ ui::XWindowManager::GetInstance()->SelectEvents(requestor,
+ PropertyChangeMask);
incremental_transfers_.push_back(
IncrementalTransfer(requestor,
target,
property,
it->second,
0,
- timeout,
- foreign_window_manager_id));
+ timeout));
// Start a timer to abort the data transfer in case that the selection
// requestor does not support the INCR property or gets destroyed during
@@ -345,8 +343,8 @@ void SelectionOwner::AbortStaleIncrementalTransfers() {
void SelectionOwner::CompleteIncrementalTransfer(
std::vector<IncrementalTransfer>::iterator it) {
- ui::XForeignWindowManager::GetInstance()->CancelRequest(
- it->foreign_window_manager_id);
+ ui::XWindowManager::GetInstance()->DeselectEvents(it->window,
+ PropertyChangeMask);
incremental_transfers_.erase(it);
if (incremental_transfers_.empty())
@@ -373,16 +371,13 @@ SelectionOwner::IncrementalTransfer::IncrementalTransfer(
XAtom property,
const scoped_refptr<base::RefCountedMemory>& data,
int offset,
- base::TimeTicks timeout,
- int foreign_window_manager_id)
+ base::TimeTicks timeout)
: window(window),
target(target),
property(property),
data(data),
offset(offset),
- timeout(timeout),
- foreign_window_manager_id(foreign_window_manager_id) {
-}
+ timeout(timeout) {}
SelectionOwner::IncrementalTransfer::IncrementalTransfer(
const IncrementalTransfer& other) = default;

Powered by Google App Engine
This is Rietveld 408576698