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

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

Issue 9151007: GTK: Seal up GSEALs, focusing on GtkSelectionData. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add gtk_widget_style_attach to make minimal version 2.18 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
diff --git a/ui/base/dragdrop/gtk_dnd_util.cc b/ui/base/dragdrop/gtk_dnd_util.cc
index 165d91bfae78fc55a85699e915c6ec978c010737..d70aac8156d40c666aa3d1a4e9e3e9335f22b32e 100644
--- a/ui/base/dragdrop/gtk_dnd_util.cc
+++ b/ui/base/dragdrop/gtk_dnd_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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 @@ void WriteURLWithName(GtkSelectionData* selection_data,
// _NETSCAPE_URL format is URL + \n + title.
std::string utf8_text = url.spec() + "\n" + UTF16ToUTF8(title);
gtk_selection_data_set(selection_data,
- selection_data->target,
+ gtk_selection_data_get_target(selection_data),
kBitsPerByte,
reinterpret_cast<const guchar*>(utf8_text.c_str()),
utf8_text.length());
@@ -209,11 +209,13 @@ void WriteURLWithName(GtkSelectionData* selection_data,
bool ExtractNamedURL(GtkSelectionData* selection_data,
GURL* url,
string16* title) {
- if (!selection_data || selection_data->length <= 0)
+ if (!selection_data || gtk_selection_data_get_length(selection_data) <= 0)
return false;
- Pickle data(reinterpret_cast<char*>(selection_data->data),
- selection_data->length);
+ Pickle data(
+ reinterpret_cast<const char*>(
+ gtk_selection_data_get_data(selection_data)),
+ gtk_selection_data_get_length(selection_data));
void* iter = NULL;
std::string title_utf8, url_utf8;
if (!data.ReadString(&iter, &title_utf8) ||
@@ -248,13 +250,15 @@ bool ExtractURIList(GtkSelectionData* selection_data, std::vector<GURL>* urls) {
bool ExtractNetscapeURL(GtkSelectionData* selection_data,
GURL* url,
string16* title) {
- if (!selection_data || selection_data->length <= 0)
+ if (!selection_data || gtk_selection_data_get_length(selection_data) <= 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<char*>(selection_data->data),
- selection_data->length);
+ std::string data(
+ reinterpret_cast<const char*>(
+ gtk_selection_data_get_data(selection_data)),
+ gtk_selection_data_get_length(selection_data));
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