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

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

Issue 16271006: Drag on linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Document Created 7 years, 6 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/selection_requestor.cc » ('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 37e8663c3bb321139878f1e1082889b5d85b475a..a5b0f4e64df4af681865322f9f65dc4f3c9f5a1c 100644
--- a/ui/base/x/selection_owner.cc
+++ b/ui/base/x/selection_owner.cc
@@ -35,6 +35,15 @@ SelectionOwner::SelectionOwner(Display* x_display,
}
SelectionOwner::~SelectionOwner() {
+ Clear();
+}
+
+void SelectionOwner::RetrieveTargets(std::vector<Atom>* targets) {
+ targets->clear();
+ for (SelectionFormatMap::const_iterator it = selection_data_->begin();
+ it != selection_data_->end(); ++it) {
+ targets->push_back(it->first);
+ }
}
void SelectionOwner::TakeOwnershipOfSelection(
@@ -73,10 +82,7 @@ void SelectionOwner::OnSelectionRequest(const XSelectionRequestEvent& event) {
// types we support.
std::vector<Atom> targets;
targets.push_back(targets_atom);
- for (SelectionFormatMap::const_iterator it = selection_data_->begin();
- it != selection_data_->end(); ++it) {
- targets.push_back(it->first);
- }
+ RetrieveTargets(&targets);
XChangeProperty(x_display_, event.requestor, event.property, XA_ATOM, 32,
PropModeReplace,
« no previous file with comments | « ui/base/x/selection_owner.h ('k') | ui/base/x/selection_requestor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698