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

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

Issue 7764010: Get rid of last views dependency in RenderWidgetHostViewWin. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 3 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 "content/browser/renderer_host/render_widget_host_view_gtk.h" 5 #include "content/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 "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #if defined(OS_CHROMEOS) 47 #if defined(OS_CHROMEOS)
48 #include "ui/base/gtk/tooltip_window_gtk.h" 48 #include "ui/base/gtk/tooltip_window_gtk.h"
49 #else 49 #else
50 #include "content/browser/renderer_host/gtk_key_bindings_handler.h" 50 #include "content/browser/renderer_host/gtk_key_bindings_handler.h"
51 #endif // defined(OS_CHROMEOS) 51 #endif // defined(OS_CHROMEOS)
52 52
53 namespace { 53 namespace {
54 54
55 const int kMaxWindowWidth = 4000; 55 const int kMaxWindowWidth = 4000;
56 const int kMaxWindowHeight = 4000; 56 const int kMaxWindowHeight = 4000;
57 const char* kRenderWidgetHostViewKey = "__RENDER_WIDGET_HOST_VIEW__";
jam 2011/08/26 22:23:37 this code, and below, were added in r38685 for an
58 57
59 // The duration of the fade-out animation. See |overlay_animation_|. 58 // The duration of the fade-out animation. See |overlay_animation_|.
60 const int kFadeEffectDuration = 300; 59 const int kFadeEffectDuration = 300;
61 60
62 #if defined(OS_CHROMEOS) 61 #if defined(OS_CHROMEOS)
63 // TODO(davemoore) Under Chromeos we are increasing the rate that the trackpad 62 // TODO(davemoore) Under Chromeos we are increasing the rate that the trackpad
64 // generates events to get better precisions. Eventually we will coordinate the 63 // generates events to get better precisions. Eventually we will coordinate the
65 // driver and this setting to ensure they match. 64 // driver and this setting to ensure they match.
66 const float kDefaultScrollPixelsPerTick = 20; 65 const float kDefaultScrollPixelsPerTick = 20;
67 #else 66 #else
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 G_CALLBACK(OnCrossingEvent), host_view); 149 G_CALLBACK(OnCrossingEvent), host_view);
151 g_signal_connect(widget, "client-event", 150 g_signal_connect(widget, "client-event",
152 G_CALLBACK(OnClientEvent), host_view); 151 G_CALLBACK(OnClientEvent), host_view);
153 152
154 153
155 // Connect after so that we are called after the handler installed by the 154 // Connect after so that we are called after the handler installed by the
156 // TabContentsView which handles zoom events. 155 // TabContentsView which handles zoom events.
157 g_signal_connect_after(widget, "scroll-event", 156 g_signal_connect_after(widget, "scroll-event",
158 G_CALLBACK(OnMouseScrollEvent), host_view); 157 G_CALLBACK(OnMouseScrollEvent), host_view);
159 158
160 g_object_set_data(G_OBJECT(widget), kRenderWidgetHostViewKey,
161 static_cast<RenderWidgetHostView*>(host_view));
162
163 return widget; 159 return widget;
164 } 160 }
165 161
166 private: 162 private:
167 static gboolean OnExposeEvent(GtkWidget* widget, 163 static gboolean OnExposeEvent(GtkWidget* widget,
168 GdkEventExpose* expose, 164 GdkEventExpose* expose,
169 RenderWidgetHostViewGtk* host_view) { 165 RenderWidgetHostViewGtk* host_view) {
170 if (host_view->is_hidden_) 166 if (host_view->is_hidden_)
171 return FALSE; 167 return FALSE;
172 const gfx::Rect damage_rect(expose->area); 168 const gfx::Rect damage_rect(expose->area);
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 last_mouse_down_ = temp; 1232 last_mouse_down_ = temp;
1237 } 1233 }
1238 1234
1239 // static 1235 // static
1240 void RenderWidgetHostView::GetDefaultScreenInfo( 1236 void RenderWidgetHostView::GetDefaultScreenInfo(
1241 WebKit::WebScreenInfo* results) { 1237 WebKit::WebScreenInfo* results) {
1242 GdkWindow* gdk_window = 1238 GdkWindow* gdk_window =
1243 gdk_display_get_default_group(gdk_display_get_default()); 1239 gdk_display_get_default_group(gdk_display_get_default());
1244 content::GetScreenInfoFromNativeWindow(gdk_window, results); 1240 content::GetScreenInfoFromNativeWindow(gdk_window, results);
1245 } 1241 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698