| 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_views.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h" |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" |
| 8 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" | 8 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" |
| 9 #include "content/browser/tab_contents/tab_contents.h" | 9 #include "content/browser/tab_contents/tab_contents.h" |
| 10 #include "content/browser/tab_contents/tab_contents_view.h" | 10 #include "content/browser/tab_contents/tab_contents_view.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // NativeTabContentsViewViews, NativeTabContentsView implementation: | 29 // NativeTabContentsViewViews, NativeTabContentsView implementation: |
| 30 | 30 |
| 31 void NativeTabContentsViewViews::InitNativeTabContentsView() { | 31 void NativeTabContentsViewViews::InitNativeTabContentsView() { |
| 32 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); | 32 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
| 33 params.native_widget = this; | 33 params.native_widget = this; |
| 34 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 34 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 35 GetWidget()->Init(params); | 35 GetWidget()->Init(params); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void NativeTabContentsViewViews::Unparent() { | 38 void NativeTabContentsViewViews::Unparent() { |
| 39 // Note that we do not DCHECK on focus_manager_ as it may be NULL when used | |
| 40 // with an external tab container. | |
| 41 views::Widget::ReparentNativeView(GetNativeView(), NULL); | |
| 42 } | 39 } |
| 43 | 40 |
| 44 RenderWidgetHostView* NativeTabContentsViewViews::CreateRenderWidgetHostView( | 41 RenderWidgetHostView* NativeTabContentsViewViews::CreateRenderWidgetHostView( |
| 45 RenderWidgetHost* render_widget_host) { | 42 RenderWidgetHost* render_widget_host) { |
| 46 RenderWidgetHostViewViews* view = | 43 RenderWidgetHostViewViews* view = |
| 47 new RenderWidgetHostViewViews(render_widget_host); | 44 new RenderWidgetHostViewViews(render_widget_host); |
| 48 GetWidget()->SetContentsView(view); | 45 GetWidget()->SetContentsView(view); |
| 49 view->Show(); | 46 view->Show(); |
| 50 view->InitAsChild(); | 47 view->InitAsChild(); |
| 51 // TODO(anicolao): implement drag'n'drop hooks if needed | 48 // TODO(anicolao): implement drag'n'drop hooks if needed |
| (...skipping 27 matching lines...) Expand all Loading... |
| 79 } | 76 } |
| 80 | 77 |
| 81 void NativeTabContentsViewViews::SetDragCursor( | 78 void NativeTabContentsViewViews::SetDragCursor( |
| 82 WebKit::WebDragOperation operation) { | 79 WebKit::WebDragOperation operation) { |
| 83 NOTIMPLEMENTED(); | 80 NOTIMPLEMENTED(); |
| 84 } | 81 } |
| 85 | 82 |
| 86 views::NativeWidget* NativeTabContentsViewViews::AsNativeWidget() { | 83 views::NativeWidget* NativeTabContentsViewViews::AsNativeWidget() { |
| 87 return this; | 84 return this; |
| 88 } | 85 } |
| OLD | NEW |