Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" |
| 6 | 6 |
| 7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 } | 322 } |
| 323 | 323 |
| 324 void DesktopDragDropClientAuraX11::X11DragContext::OnSelectionNotify( | 324 void DesktopDragDropClientAuraX11::X11DragContext::OnSelectionNotify( |
| 325 const XSelectionEvent& event) { | 325 const XSelectionEvent& event) { |
| 326 if (!waiting_to_handle_position_) { | 326 if (!waiting_to_handle_position_) { |
| 327 // A misbehaved window may send SelectionNotify without us requesting data | 327 // A misbehaved window may send SelectionNotify without us requesting data |
| 328 // via XConvertSelection(). | 328 // via XConvertSelection(). |
| 329 return; | 329 return; |
| 330 } | 330 } |
| 331 DCHECK(drag_drop_client_); | 331 DCHECK(drag_drop_client_); |
| 332 | |
| 333 if (event.property == None) { | |
| 334 // The selection conversion failed. This actually happens in real life. | |
| 335 // http://crbug.com/628099 | |
|
Elliot Glaysher
2016/09/27 23:39:10
Should this be an early return or a check around a
pwnall
2016/09/30 20:02:17
Done.
Thank you very much for asking this question
| |
| 336 return; | |
| 337 } | |
| 338 | |
| 332 DCHECK_EQ(event.property, atom_cache_->GetAtom(kChromiumDragReciever)); | 339 DCHECK_EQ(event.property, atom_cache_->GetAtom(kChromiumDragReciever)); |
| 333 | 340 |
| 334 scoped_refptr<base::RefCountedMemory> data; | 341 scoped_refptr<base::RefCountedMemory> data; |
| 335 ::Atom type = None; | 342 ::Atom type = None; |
| 336 if (ui::GetRawBytesOfProperty(local_window_, event.property, | 343 if (ui::GetRawBytesOfProperty(local_window_, event.property, |
| 337 &data, NULL, &type)) { | 344 &data, NULL, &type)) { |
| 338 fetched_targets_.Insert(event.target, data); | 345 fetched_targets_.Insert(event.target, data); |
| 339 } | 346 } |
| 340 | 347 |
| 341 if (!unfetched_targets_.empty()) { | 348 if (!unfetched_targets_.empty()) { |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1225 for (int x = 0; x < in_bitmap->width(); ++x) { | 1232 for (int x = 0; x < in_bitmap->width(); ++x) { |
| 1226 if (SkColorGetA(in_row[x]) > kMinAlpha) | 1233 if (SkColorGetA(in_row[x]) > kMinAlpha) |
| 1227 return true; | 1234 return true; |
| 1228 } | 1235 } |
| 1229 } | 1236 } |
| 1230 | 1237 |
| 1231 return false; | 1238 return false; |
| 1232 } | 1239 } |
| 1233 | 1240 |
| 1234 } // namespace views | 1241 } // namespace views |
| OLD | NEW |