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

Side by Side Diff: chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc

Issue 7031053: Make Widget ownership a little clearer by expressing it in terms of an enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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/ui/views/tab_contents/native_tab_contents_view_gtk.h" 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h"
6 6
7 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" 7 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
8 #include "chrome/browser/tab_contents/web_drag_dest_gtk.h" 8 #include "chrome/browser/tab_contents/web_drag_dest_gtk.h"
9 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" 9 #include "chrome/browser/ui/gtk/constrained_window_gtk.h"
10 #include "chrome/browser/ui/gtk/tab_contents_drag_source.h" 10 #include "chrome/browser/ui/gtk/tab_contents_drag_source.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 RemoveChild((*item)->widget()); 98 RemoveChild((*item)->widget());
99 constrained_windows_.erase(item); 99 constrained_windows_.erase(item);
100 } 100 }
101 101
102 //////////////////////////////////////////////////////////////////////////////// 102 ////////////////////////////////////////////////////////////////////////////////
103 // NativeTabContentsViewGtk, NativeTabContentsView implementation: 103 // NativeTabContentsViewGtk, NativeTabContentsView implementation:
104 104
105 void NativeTabContentsViewGtk::InitNativeTabContentsView() { 105 void NativeTabContentsViewGtk::InitNativeTabContentsView() {
106 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); 106 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
107 params.native_widget = this; 107 params.native_widget = this;
108 params.delete_on_destroy = false; 108 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
109 GetWidget()->Init(params); 109 GetWidget()->Init(params);
110 110
111 // We need to own the widget in order to attach/detach the native view to a 111 // We need to own the widget in order to attach/detach the native view to a
112 // container. 112 // container.
113 gtk_object_ref(GTK_OBJECT(GetWidget()->GetNativeView())); 113 gtk_object_ref(GTK_OBJECT(GetWidget()->GetNativeView()));
114 } 114 }
115 115
116 void NativeTabContentsViewGtk::Unparent() { 116 void NativeTabContentsViewGtk::Unparent() {
117 } 117 }
118 118
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 //////////////////////////////////////////////////////////////////////////////// 257 ////////////////////////////////////////////////////////////////////////////////
258 // NativeTabContentsView, public: 258 // NativeTabContentsView, public:
259 259
260 // static 260 // static
261 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( 261 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView(
262 internal::NativeTabContentsViewDelegate* delegate) { 262 internal::NativeTabContentsViewDelegate* delegate) {
263 return new NativeTabContentsViewGtk(delegate); 263 return new NativeTabContentsViewGtk(delegate);
264 } 264 }
265 265
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/status_bubble_views.cc ('k') | chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698