OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tab_contents/tab_contents_view_gtk.h" | 5 #include "content/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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 TabContentsViewGtk::~TabContentsViewGtk() { | 100 TabContentsViewGtk::~TabContentsViewGtk() { |
101 expanded_.Destroy(); | 101 expanded_.Destroy(); |
102 } | 102 } |
103 | 103 |
104 void TabContentsViewGtk::CreateView(const gfx::Size& initial_size) { | 104 void TabContentsViewGtk::CreateView(const gfx::Size& initial_size) { |
105 requested_size_ = initial_size; | 105 requested_size_ = initial_size; |
106 } | 106 } |
107 | 107 |
108 RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget( | 108 RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget( |
109 RenderWidgetHost* render_widget_host) { | 109 RenderWidgetHost* render_widget_host) { |
110 if (render_widget_host->view()) { | 110 if (render_widget_host->GetView()) { |
111 // During testing, the view will already be set up in most cases to the | 111 // During testing, the view will already be set up in most cases to the |
112 // test view, so we don't want to clobber it with a real one. To verify that | 112 // test view, so we don't want to clobber it with a real one. To verify that |
113 // this actually is happening (and somebody isn't accidentally creating the | 113 // this actually is happening (and somebody isn't accidentally creating the |
114 // view twice), we check for the RVH Factory, which will be set when we're | 114 // view twice), we check for the RVH Factory, which will be set when we're |
115 // making special ones (which go along with the special views). | 115 // making special ones (which go along with the special views). |
116 DCHECK(RenderViewHostFactory::has_factory()); | 116 DCHECK(RenderViewHostFactory::has_factory()); |
117 return render_widget_host->view(); | 117 return render_widget_host->GetView(); |
118 } | 118 } |
119 | 119 |
120 RenderWidgetHostView* view = | 120 RenderWidgetHostView* view = |
121 RenderWidgetHostView::CreateViewForWidget(render_widget_host); | 121 RenderWidgetHostView::CreateViewForWidget(render_widget_host); |
122 view->InitAsChild(NULL); | 122 view->InitAsChild(NULL); |
123 gfx::NativeView content_view = view->GetNativeView(); | 123 gfx::NativeView content_view = view->GetNativeView(); |
124 g_signal_connect(content_view, "focus", G_CALLBACK(OnFocusThunk), this); | 124 g_signal_connect(content_view, "focus", G_CALLBACK(OnFocusThunk), this); |
125 g_signal_connect(content_view, "leave-notify-event", | 125 g_signal_connect(content_view, "leave-notify-event", |
126 G_CALLBACK(OnLeaveNotify), tab_contents_); | 126 G_CALLBACK(OnLeaveNotify), tab_contents_); |
127 g_signal_connect(content_view, "motion-notify-event", | 127 g_signal_connect(content_view, "motion-notify-event", |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // We manually tell our RWHV to resize the renderer content. This avoids | 443 // We manually tell our RWHV to resize the renderer content. This avoids |
444 // spurious resizes from GTK+. | 444 // spurious resizes from GTK+. |
445 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); | 445 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); |
446 if (rwhv) | 446 if (rwhv) |
447 rwhv->SetSize(size); | 447 rwhv->SetSize(size); |
448 if (tab_contents_->GetInterstitialPage()) | 448 if (tab_contents_->GetInterstitialPage()) |
449 tab_contents_->GetInterstitialPage()->SetSize(size); | 449 tab_contents_->GetInterstitialPage()->SetSize(size); |
450 } | 450 } |
451 | 451 |
452 } // namespace content | 452 } // namespace content |
OLD | NEW |