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

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

Issue 42119: Have RenderWidgetHostViewGtk take ownership of its widget. (Closed)
Patch Set: Created 11 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <gdk/gdk.h> 8 #include <gdk/gdk.h>
9 #include <cairo/cairo.h> 9 #include <cairo/cairo.h>
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // static 129 // static
130 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( 130 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
131 RenderWidgetHost* widget) { 131 RenderWidgetHost* widget) {
132 return new RenderWidgetHostViewGtk(widget); 132 return new RenderWidgetHostViewGtk(widget);
133 } 133 }
134 134
135 RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(RenderWidgetHost* widget_host) 135 RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(RenderWidgetHost* widget_host)
136 : host_(widget_host) { 136 : host_(widget_host) {
137 host_->set_view(this); 137 host_->set_view(this);
138 view_ = RenderWidgetHostViewGtkWidget::CreateNewWidget(this); 138 view_ = RenderWidgetHostViewGtkWidget::CreateNewWidget(this);
139 // BUG 8707: We will live in some container (in this case in WebContents).
140 // We want to destroy during Destroy(), independent of how we are managed in
141 // any containers. We need to sink the reference here to "own" the widget so
142 // it can be added and removed from containers without being destroyed.
143 g_object_ref_sink(view_);
139 } 144 }
140 145
141 RenderWidgetHostViewGtk::~RenderWidgetHostViewGtk() { 146 RenderWidgetHostViewGtk::~RenderWidgetHostViewGtk() {
142 } 147 }
143 148
144 void RenderWidgetHostViewGtk::DidBecomeSelected() { 149 void RenderWidgetHostViewGtk::DidBecomeSelected() {
145 NOTIMPLEMENTED(); 150 NOTIMPLEMENTED();
146 } 151 }
147 152
148 void RenderWidgetHostViewGtk::WasHidden() { 153 void RenderWidgetHostViewGtk::WasHidden() {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 // Destroy()ed yet and it receives paint messages... 292 // Destroy()ed yet and it receives paint messages...
288 GdkWindow* window = view_->window; 293 GdkWindow* window = view_->window;
289 if (window) { 294 if (window) {
290 backing_store->ShowRect( 295 backing_store->ShowRect(
291 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_)); 296 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_));
292 } 297 }
293 } else { 298 } else {
294 NOTIMPLEMENTED(); 299 NOTIMPLEMENTED();
295 } 300 }
296 } 301 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698