OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/tab_contents/tab_contents_view_gtk.h" | 5 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 // data->data will be NULL. | 240 // data->data will be NULL. |
241 if (data->target == | 241 if (data->target == |
242 GtkDndUtil::GetAtomForTarget(GtkDndUtil::TEXT_PLAIN)) { | 242 GtkDndUtil::GetAtomForTarget(GtkDndUtil::TEXT_PLAIN)) { |
243 guchar* text = gtk_selection_data_get_text(data); | 243 guchar* text = gtk_selection_data_get_text(data); |
244 if (text) { | 244 if (text) { |
245 drop_data_->plain_text = UTF8ToUTF16(std::string( | 245 drop_data_->plain_text = UTF8ToUTF16(std::string( |
246 reinterpret_cast<char*>(text), data->length)); | 246 reinterpret_cast<char*>(text), data->length)); |
247 g_free(text); | 247 g_free(text); |
248 } | 248 } |
249 } else if (data->target == | 249 } else if (data->target == |
250 GtkDndUtil::GetAtomForTarget(GtkDndUtil::TEXT_URI_LIST)) { | 250 GtkDndUtil::GetAtomForTarget(GtkDndUtil::TEXT_URI_LIST)) { |
Nico
2009/09/18 01:05:42
Previous indentation looked more right to me (and
Evan Stade
2009/09/18 02:43:42
changes to this file dropped
| |
251 gchar** uris = gtk_selection_data_get_uris(data); | 251 gchar** uris = gtk_selection_data_get_uris(data); |
252 if (uris) { | 252 if (uris) { |
253 for (gchar** uri_iter = uris; *uri_iter; uri_iter++) { | 253 for (gchar** uri_iter = uris; *uri_iter; uri_iter++) { |
254 // TODO(estade): Can the filenames have a non-UTF8 encoding? | 254 // TODO(estade): Can the filenames have a non-UTF8 encoding? |
255 drop_data_->filenames.push_back(UTF8ToUTF16(*uri_iter)); | 255 drop_data_->filenames.push_back(UTF8ToUTF16(*uri_iter)); |
256 } | 256 } |
257 // Also, write the first URI as the URL. | 257 // Also, write the first URI as the URL. |
258 if (uris[0]) | 258 if (uris[0]) |
259 drop_data_->url = GURL(uris[0]); | 259 drop_data_->url = GURL(uris[0]); |
260 g_strfreev(uris); | 260 g_strfreev(uris); |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
695 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 695 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
696 widget, "x", &value); | 696 widget, "x", &value); |
697 | 697 |
698 int child_y = std::max(half_view_height - (requisition.height / 2), 0); | 698 int child_y = std::max(half_view_height - (requisition.height / 2), 0); |
699 g_value_set_int(&value, child_y); | 699 g_value_set_int(&value, child_y); |
700 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 700 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
701 widget, "y", &value); | 701 widget, "y", &value); |
702 g_value_unset(&value); | 702 g_value_unset(&value); |
703 } | 703 } |
704 } | 704 } |
OLD | NEW |