diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 19:12:53 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 19:12:53 +0000 |
commit | db89440b21bf4950a18f4479aaa961cfe13de035 (patch) | |
tree | 751748488e9d42892835457bed3b91495bd4e1fa /ui/base/dragdrop | |
parent | da7582b7e45e5f0aac0a1b072580be65b1502334 (diff) | |
download | chromium_src-db89440b21bf4950a18f4479aaa961cfe13de035.zip chromium_src-db89440b21bf4950a18f4479aaa961cfe13de035.tar.gz chromium_src-db89440b21bf4950a18f4479aaa961cfe13de035.tar.bz2 |
GTK: Seal up GSEALs, focusing on GtkSelectionData.
BUG=79722
TEST=compiles
First Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=116956
Review URL: http://codereview.chromium.org/9151007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/dragdrop')
-rw-r--r-- | ui/base/dragdrop/gtk_dnd_util.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ui/base/dragdrop/gtk_dnd_util.cc b/ui/base/dragdrop/gtk_dnd_util.cc index 165d91b..d70aac8 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; |