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

Unified Diff: ui/base/dragdrop/gtk_dnd_util.cc

Issue 9167002: Revert 116956 - GTK: Seal up GSEALs, focusing on GtkSelectionData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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/clipboard/clipboard_gtk.cc ('k') | ui/base/gtk/focus_store_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dragdrop/gtk_dnd_util.cc
===================================================================
--- ui/base/dragdrop/gtk_dnd_util.cc (revision 116976)
+++ ui/base/dragdrop/gtk_dnd_util.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -192,7 +192,7 @@
// _NETSCAPE_URL format is URL + \n + title.
std::string utf8_text = url.spec() + "\n" + UTF16ToUTF8(title);
gtk_selection_data_set(selection_data,
- gtk_selection_data_get_target(selection_data),
+ selection_data->target,
kBitsPerByte,
reinterpret_cast<const guchar*>(utf8_text.c_str()),
utf8_text.length());
@@ -209,13 +209,11 @@
bool ExtractNamedURL(GtkSelectionData* selection_data,
GURL* url,
string16* title) {
- if (!selection_data || gtk_selection_data_get_length(selection_data) <= 0)
+ if (!selection_data || selection_data->length <= 0)
return false;
- Pickle data(
- reinterpret_cast<const char*>(
- gtk_selection_data_get_data(selection_data)),
- gtk_selection_data_get_length(selection_data));
+ Pickle data(reinterpret_cast<char*>(selection_data->data),
+ selection_data->length);
void* iter = NULL;
std::string title_utf8, url_utf8;
if (!data.ReadString(&iter, &title_utf8) ||
@@ -250,15 +248,13 @@
bool ExtractNetscapeURL(GtkSelectionData* selection_data,
GURL* url,
string16* title) {
- if (!selection_data || gtk_selection_data_get_length(selection_data) <= 0)
+ if (!selection_data || selection_data->length <= 0)
return false;
// Find the first '\n' in the data. It is the separator between the url and
// the title.
- std::string data(
- reinterpret_cast<const char*>(
- gtk_selection_data_get_data(selection_data)),
- gtk_selection_data_get_length(selection_data));
+ std::string data(reinterpret_cast<char*>(selection_data->data),
+ selection_data->length);
std::string::size_type newline = data.find('\n');
if (newline == std::string::npos)
return false;
« no previous file with comments | « ui/base/clipboard/clipboard_gtk.cc ('k') | ui/base/gtk/focus_store_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698