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

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

Issue 14189002: linux_aura: Implement dropping in chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 7 years, 8 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_requestor.h ('k') | ui/base/x/selection_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/selection_requestor.cc
diff --git a/ui/base/x/selection_requestor.cc b/ui/base/x/selection_requestor.cc
index 0aec0864f75cfe2f041c39b0af48ab2c418e996f..830d692902cc2da8d11d23377136818e8678111e 100644
--- a/ui/base/x/selection_requestor.cc
+++ b/ui/base/x/selection_requestor.cc
@@ -6,6 +6,7 @@
#include "base/message_pump_aurax11.h"
#include "base/run_loop.h"
+#include "ui/base/x/selection_utils.h"
namespace ui {
@@ -116,6 +117,28 @@ bool SelectionRequestor::PerformBlockingConvertSelection(
return true;
}
+scoped_ptr<SelectionData> SelectionRequestor::RequestAndWaitForTypes(
+ const std::vector< ::Atom>& types) {
+ for (std::vector< ::Atom>::const_iterator it = types.begin();
+ it != types.end(); ++it) {
+ unsigned char* data = NULL;
+ size_t data_bytes = 0;
+ ::Atom type = None;
+ if (PerformBlockingConvertSelection(*it,
+ &data,
+ &data_bytes,
+ NULL,
+ &type) &&
+ type == *it) {
+ scoped_ptr<SelectionData> data_out(new SelectionData(x_display_));
+ data_out->Set(type, (char*)data, data_bytes, true);
+ return data_out.Pass();
+ }
+ }
+
+ return scoped_ptr<SelectionData>();
+}
+
void SelectionRequestor::OnSelectionNotify(const XSelectionEvent& event) {
if (!in_nested_loop_) {
// This shouldn't happen; we're not waiting on the X server for data, but
« no previous file with comments | « ui/base/x/selection_requestor.h ('k') | ui/base/x/selection_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698