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

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: Further cleanup 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
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..f5bf4217a8c95964728dcffdff5a1209627831d2 100644
--- a/ui/base/x/selection_owner.cc
+++ b/ui/base/x/selection_owner.cc
@@ -35,6 +35,14 @@ SelectionOwner::SelectionOwner(Display* x_display,
}
SelectionOwner::~SelectionOwner() {
+ Clear();
+}
+
+void SelectionOwner::RetrieveTargets(std::vector<Atom>* targets) {
Daniel Erat 2013/06/17 22:09:57 nit: either clear |targets| first here or document
+ for (SelectionFormatMap::const_iterator it = selection_data_->begin();
+ it != selection_data_->end(); ++it) {
+ targets->push_back(it->first);
+ }
}
void SelectionOwner::TakeOwnershipOfSelection(
@@ -73,10 +81,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,

Powered by Google App Engine
This is Rietveld 408576698