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

Side by Side Diff: ui/base/dragdrop/os_exchange_data_provider_gtk.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderText fixup Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/dragdrop/os_exchange_data_provider_gtk.h" 5 #include "ui/base/dragdrop/os_exchange_data_provider_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 GURL test_url(string_); 215 GURL test_url(string_);
216 if (!test_url.is_valid()) 216 if (!test_url.is_valid())
217 return false; 217 return false;
218 218
219 if (url) 219 if (url)
220 *url = test_url; 220 *url = test_url;
221 return true; 221 return true;
222 } 222 }
223 223
224 void OSExchangeDataProviderGtk::SetDragImage(GdkPixbuf* drag_image, 224 void OSExchangeDataProviderGtk::SetDragImage(
225 const gfx::Point& cursor_offset) { 225 GdkPixbuf* drag_image,
226 const gfx::Vector2d& cursor_offset) {
226 if (drag_image_) 227 if (drag_image_)
227 g_object_unref(drag_image_); 228 g_object_unref(drag_image_);
228 g_object_ref(drag_image); 229 g_object_ref(drag_image);
229 drag_image_ = drag_image; 230 drag_image_ = drag_image;
230 cursor_offset_ = cursor_offset; 231 cursor_offset_ = cursor_offset;
231 } 232 }
232 233
233 /////////////////////////////////////////////////////////////////////////////// 234 ///////////////////////////////////////////////////////////////////////////////
234 // OSExchangeData, public: 235 // OSExchangeData, public:
235 236
236 // static 237 // static
237 OSExchangeData::Provider* OSExchangeData::CreateProvider() { 238 OSExchangeData::Provider* OSExchangeData::CreateProvider() {
238 return new OSExchangeDataProviderGtk(); 239 return new OSExchangeDataProviderGtk();
239 } 240 }
240 241
241 GdkAtom OSExchangeData::RegisterCustomFormat(const std::string& type) { 242 GdkAtom OSExchangeData::RegisterCustomFormat(const std::string& type) {
242 return gdk_atom_intern(type.c_str(), false); 243 return gdk_atom_intern(type.c_str(), false);
243 } 244 }
244 245
245 } // namespace ui 246 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698