| OLD | NEW |
| 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 "chrome/browser/renderer_host/render_widget_host_view_gtk.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" |
| 6 | 6 |
| 7 // If this gets included after the gtk headers, then a bunch of compiler | 7 // If this gets included after the gtk headers, then a bunch of compiler |
| 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts | 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts |
| 9 // badly with net::URLRequestStatus::Status. | 9 // badly with net::URLRequestStatus::Status. |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 } else { | 828 } else { |
| 829 gtk_widget_set_tooltip_text(view_.get(), | 829 gtk_widget_set_tooltip_text(view_.get(), |
| 830 UTF16ToUTF8(clamped_tooltip).c_str()); | 830 UTF16ToUTF8(clamped_tooltip).c_str()); |
| 831 #if defined(OS_CHROMEOS) | 831 #if defined(OS_CHROMEOS) |
| 832 tooltip_window_->SetTooltipText(UTF16ToWideHack(clamped_tooltip)); | 832 tooltip_window_->SetTooltipText(UTF16ToWideHack(clamped_tooltip)); |
| 833 #endif // defined(OS_CHROMEOS) | 833 #endif // defined(OS_CHROMEOS) |
| 834 } | 834 } |
| 835 } | 835 } |
| 836 | 836 |
| 837 void RenderWidgetHostViewGtk::SelectionChanged(const std::string& text, | 837 void RenderWidgetHostViewGtk::SelectionChanged(const std::string& text, |
| 838 const ui::Range& range, | 838 const ui::Range& range) { |
| 839 const gfx::Point& start, | |
| 840 const gfx::Point& end) { | |
| 841 if (!text.empty()) { | 839 if (!text.empty()) { |
| 842 GtkClipboard* x_clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); | 840 GtkClipboard* x_clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); |
| 843 gtk_clipboard_set_text(x_clipboard, text.c_str(), text.length()); | 841 gtk_clipboard_set_text(x_clipboard, text.c_str(), text.length()); |
| 844 } | 842 } |
| 845 } | 843 } |
| 846 | 844 |
| 847 void RenderWidgetHostViewGtk::ShowingContextMenu(bool showing) { | 845 void RenderWidgetHostViewGtk::ShowingContextMenu(bool showing) { |
| 848 is_showing_context_menu_ = showing; | 846 is_showing_context_menu_ = showing; |
| 849 } | 847 } |
| 850 | 848 |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 } | 1185 } |
| 1188 | 1186 |
| 1189 // static | 1187 // static |
| 1190 RenderWidgetHostView* | 1188 RenderWidgetHostView* |
| 1191 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1189 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 1192 gfx::NativeView widget) { | 1190 gfx::NativeView widget) { |
| 1193 gpointer user_data = g_object_get_data(G_OBJECT(widget), | 1191 gpointer user_data = g_object_get_data(G_OBJECT(widget), |
| 1194 kRenderWidgetHostViewKey); | 1192 kRenderWidgetHostViewKey); |
| 1195 return reinterpret_cast<RenderWidgetHostView*>(user_data); | 1193 return reinterpret_cast<RenderWidgetHostView*>(user_data); |
| 1196 } | 1194 } |
| OLD | NEW |