| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/base/x/selection_owner.h" | 5 #include "ui/base/x/selection_owner.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 | 10 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 targets.size()); | 240 targets.size()); |
| 241 return true; | 241 return true; |
| 242 } else { | 242 } else { |
| 243 // Try to find the data type in map. | 243 // Try to find the data type in map. |
| 244 SelectionFormatMap::const_iterator it = format_map_.find(target); | 244 SelectionFormatMap::const_iterator it = format_map_.find(target); |
| 245 if (it != format_map_.end()) { | 245 if (it != format_map_.end()) { |
| 246 if (it->second->size() > max_request_size_) { | 246 if (it->second->size() > max_request_size_) { |
| 247 // We must send the data back in several chunks due to a limitation in | 247 // We must send the data back in several chunks due to a limitation in |
| 248 // the size of X requests. Notify the selection requestor that the data | 248 // the size of X requests. Notify the selection requestor that the data |
| 249 // will be sent incrementally by returning data of type "INCR". | 249 // will be sent incrementally by returning data of type "INCR". |
| 250 int length = it->second->size(); | 250 long length = it->second->size(); |
| 251 XChangeProperty(x_display_, | 251 XChangeProperty(x_display_, |
| 252 requestor, | 252 requestor, |
| 253 property, | 253 property, |
| 254 atom_cache_.GetAtom(kIncr), | 254 atom_cache_.GetAtom(kIncr), |
| 255 32, | 255 32, |
| 256 PropModeReplace, | 256 PropModeReplace, |
| 257 reinterpret_cast<unsigned char*>(&length), | 257 reinterpret_cast<unsigned char*>(&length), |
| 258 1); | 258 1); |
| 259 | 259 |
| 260 // Wait for the selection requestor to indicate that it has processed | 260 // Wait for the selection requestor to indicate that it has processed |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 data(data), | 375 data(data), |
| 376 offset(offset), | 376 offset(offset), |
| 377 timeout(timeout), | 377 timeout(timeout), |
| 378 foreign_window_manager_id(foreign_window_manager_id) { | 378 foreign_window_manager_id(foreign_window_manager_id) { |
| 379 } | 379 } |
| 380 | 380 |
| 381 SelectionOwner::IncrementalTransfer::~IncrementalTransfer() { | 381 SelectionOwner::IncrementalTransfer::~IncrementalTransfer() { |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace ui | 384 } // namespace ui |
| OLD | NEW |