OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h" |
| 6 |
| 7 #include "chrome/browser/tab_contents/web_drop_target_win.h" |
| 8 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" |
| 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h" |
| 10 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" |
| 11 #include "content/browser/tab_contents/tab_contents.h" |
| 12 #include "content/browser/tab_contents/tab_contents_view.h" |
| 13 #include "views/views_delegate.h" |
| 14 #include "views/widget/widget.h" |
| 15 |
| 16 //////////////////////////////////////////////////////////////////////////////// |
| 17 // NativeTabContentsViewAura, public: |
| 18 |
| 19 NativeTabContentsViewAura::NativeTabContentsViewAura( |
| 20 internal::NativeTabContentsViewDelegate* delegate) |
| 21 : views::NativeWidgetAura(delegate->AsNativeWidgetDelegate()), |
| 22 delegate_(delegate) { |
| 23 } |
| 24 |
| 25 NativeTabContentsViewAura::~NativeTabContentsViewAura() { |
| 26 } |
| 27 |
| 28 TabContents* NativeTabContentsViewAura::GetTabContents() const { |
| 29 return delegate_->GetTabContents(); |
| 30 } |
| 31 |
| 32 void NativeTabContentsViewAura::EndDragging() { |
| 33 delegate_->OnNativeTabContentsViewDraggingEnded(); |
| 34 // TODO(beng): |
| 35 NOTIMPLEMENTED(); |
| 36 } |
| 37 |
| 38 //////////////////////////////////////////////////////////////////////////////// |
| 39 // NativeTabContentsViewAura, NativeTabContentsView implementation: |
| 40 |
| 41 void NativeTabContentsViewAura::InitNativeTabContentsView() { |
| 42 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
| 43 params.native_widget = this; |
| 44 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 45 params.parent = NULL; |
| 46 GetWidget()->Init(params); |
| 47 } |
| 48 |
| 49 void NativeTabContentsViewAura::Unparent() { |
| 50 // Note that we do not DCHECK on focus_manager_ as it may be NULL when used |
| 51 // with an external tab container. |
| 52 views::Widget::ReparentNativeView(GetNativeView(), NULL); |
| 53 // TODO(beng): |
| 54 NOTIMPLEMENTED(); |
| 55 } |
| 56 |
| 57 RenderWidgetHostView* NativeTabContentsViewAura::CreateRenderWidgetHostView( |
| 58 RenderWidgetHost* render_widget_host) { |
| 59 // TODO(beng): probably return RenderWidgetHostViewViews. |
| 60 NOTIMPLEMENTED(); |
| 61 return NULL; |
| 62 } |
| 63 |
| 64 gfx::NativeWindow NativeTabContentsViewAura::GetTopLevelNativeWindow() const { |
| 65 // TODO(beng): |
| 66 NOTIMPLEMENTED(); |
| 67 return NULL; |
| 68 } |
| 69 |
| 70 void NativeTabContentsViewAura::SetPageTitle(const std::wstring& title) { |
| 71 // TODO(beng): |
| 72 NOTIMPLEMENTED(); |
| 73 } |
| 74 |
| 75 void NativeTabContentsViewAura::StartDragging(const WebDropData& drop_data, |
| 76 WebKit::WebDragOperationsMask ops, |
| 77 const SkBitmap& image, |
| 78 const gfx::Point& image_offset) { |
| 79 // TODO(beng): |
| 80 NOTIMPLEMENTED(); |
| 81 } |
| 82 |
| 83 void NativeTabContentsViewAura::CancelDrag() { |
| 84 // TODO(beng): |
| 85 NOTIMPLEMENTED(); |
| 86 } |
| 87 |
| 88 bool NativeTabContentsViewAura::IsDoingDrag() const { |
| 89 // TODO(beng): |
| 90 NOTIMPLEMENTED(); |
| 91 return false; |
| 92 } |
| 93 |
| 94 void NativeTabContentsViewAura::SetDragCursor( |
| 95 WebKit::WebDragOperation operation) { |
| 96 // TODO(beng): |
| 97 NOTIMPLEMENTED(); |
| 98 } |
| 99 |
| 100 views::NativeWidget* NativeTabContentsViewAura::AsNativeWidget() { |
| 101 return this; |
| 102 } |
| 103 |
| 104 //////////////////////////////////////////////////////////////////////////////// |
| 105 // NativeTabContentsViewWin, views::NativeWidgetWin overrides: |
| 106 |
| 107 //////////////////////////////////////////////////////////////////////////////// |
| 108 // NativeTabContentsView, public: |
| 109 |
| 110 // static |
| 111 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( |
| 112 internal::NativeTabContentsViewDelegate* delegate) { |
| 113 return new NativeTabContentsViewAura(delegate); |
| 114 } |
OLD | NEW |