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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 6289009: [Mac] Implement the system dictionary popup by implementing NSTextInput methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Plumb selection rannge with ViewHostMsg_SelectionChanged Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 gtk_widget_set_has_tooltip(view_.get(), FALSE); 731 gtk_widget_set_has_tooltip(view_.get(), FALSE);
732 } else { 732 } else {
733 gtk_widget_set_tooltip_text(view_.get(), 733 gtk_widget_set_tooltip_text(view_.get(),
734 UTF16ToUTF8(clamped_tooltip).c_str()); 734 UTF16ToUTF8(clamped_tooltip).c_str());
735 #if defined(OS_CHROMEOS) 735 #if defined(OS_CHROMEOS)
736 tooltip_window_->SetTooltipText(UTF16ToWideHack(clamped_tooltip)); 736 tooltip_window_->SetTooltipText(UTF16ToWideHack(clamped_tooltip));
737 #endif // defined(OS_CHROMEOS) 737 #endif // defined(OS_CHROMEOS)
738 } 738 }
739 } 739 }
740 740
741 void RenderWidgetHostViewGtk::SelectionChanged(const std::string& text) { 741 void RenderWidgetHostViewGtk::SelectionChanged(const std::string& text,
742 int start,
743 int end) {
742 if (!text.empty()) { 744 if (!text.empty()) {
743 GtkClipboard* x_clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); 745 GtkClipboard* x_clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
744 gtk_clipboard_set_text(x_clipboard, text.c_str(), text.length()); 746 gtk_clipboard_set_text(x_clipboard, text.c_str(), text.length());
745 } 747 }
746 } 748 }
747 749
748 void RenderWidgetHostViewGtk::ShowingContextMenu(bool showing) { 750 void RenderWidgetHostViewGtk::ShowingContextMenu(bool showing) {
749 is_showing_context_menu_ = showing; 751 is_showing_context_menu_ = showing;
750 } 752 }
751 753
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 } 1123 }
1122 1124
1123 // static 1125 // static
1124 RenderWidgetHostView* 1126 RenderWidgetHostView*
1125 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( 1127 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView(
1126 gfx::NativeView widget) { 1128 gfx::NativeView widget) {
1127 gpointer user_data = g_object_get_data(G_OBJECT(widget), 1129 gpointer user_data = g_object_get_data(G_OBJECT(widget),
1128 kRenderWidgetHostViewKey); 1130 kRenderWidgetHostViewKey);
1129 return reinterpret_cast<RenderWidgetHostView*>(user_data); 1131 return reinterpret_cast<RenderWidgetHostView*>(user_data);
1130 } 1132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698