| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |