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

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

Issue 2313033002: Refactor X11ForeignWindowManager (Reland) (Closed)
Patch Set: Rebase 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
« no previous file with comments | « ui/base/x/selection_owner.h ('k') | ui/base/x/x11_foreign_window_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ea0ad226f32eafebc45101073a89fba1b5e146c6 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_event_manager.h"
#include "ui/events/platform/x11/x11_event_source.h"
namespace ui {
@@ -269,17 +269,10 @@ 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);
- incremental_transfers_.push_back(
- IncrementalTransfer(requestor,
- target,
- property,
- it->second,
- 0,
- timeout,
- foreign_window_manager_id));
+ requestor_events_.reset(
+ new ui::XScopedEventSelector(requestor, PropertyChangeMask));
+ incremental_transfers_.push_back(IncrementalTransfer(
+ requestor, target, property, it->second, 0, 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 +338,8 @@ void SelectionOwner::AbortStaleIncrementalTransfers() {
void SelectionOwner::CompleteIncrementalTransfer(
std::vector<IncrementalTransfer>::iterator it) {
- ui::XForeignWindowManager::GetInstance()->CancelRequest(
- it->foreign_window_manager_id);
+ requestor_events_.reset();
+
incremental_transfers_.erase(it);
if (incremental_transfers_.empty())
@@ -373,16 +366,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;
« no previous file with comments | « ui/base/x/selection_owner.h ('k') | ui/base/x/x11_foreign_window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698