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

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

Issue 2326223002: Revert of Refactor X11ForeignWindowManager (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
« 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 ea0ad226f32eafebc45101073a89fba1b5e146c6..af58a3787a58d8548386e4219cee3f83bc5069f5 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,10 +269,17 @@
base::TimeTicks timeout =
base::TimeTicks::Now() +
base::TimeDelta::FromMilliseconds(kIncrementalTransferTimeoutMs);
- requestor_events_.reset(
- new ui::XScopedEventSelector(requestor, PropertyChangeMask));
- incremental_transfers_.push_back(IncrementalTransfer(
- requestor, target, property, it->second, 0, timeout));
+ 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));
// Start a timer to abort the data transfer in case that the selection
// requestor does not support the INCR property or gets destroyed during
@@ -338,8 +345,8 @@
void SelectionOwner::CompleteIncrementalTransfer(
std::vector<IncrementalTransfer>::iterator it) {
- requestor_events_.reset();
-
+ ui::XForeignWindowManager::GetInstance()->CancelRequest(
+ it->foreign_window_manager_id);
incremental_transfers_.erase(it);
if (incremental_transfers_.empty())
@@ -366,13 +373,16 @@
XAtom property,
const scoped_refptr<base::RefCountedMemory>& data,
int offset,
- base::TimeTicks timeout)
+ base::TimeTicks timeout,
+ int foreign_window_manager_id)
: window(window),
target(target),
property(property),
data(data),
offset(offset),
- timeout(timeout) {}
+ timeout(timeout),
+ foreign_window_manager_id(foreign_window_manager_id) {
+}
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