| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_aura.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h" |
| 6 | 6 |
| 7 #include "base/event_types.h" | 7 #include "base/event_types.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #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_delegate
.h" |
| 10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" | 21 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" |
| 22 #include "ui/views/views_delegate.h" | 22 #include "ui/views/views_delegate.h" |
| 23 #include "ui/views/widget/widget.h" | 23 #include "ui/views/widget/widget.h" |
| 24 #include "webkit/glue/webdropdata.h" | 24 #include "webkit/glue/webdropdata.h" |
| 25 | 25 |
| 26 #if defined(USE_ASH) | 26 #if defined(USE_ASH) |
| 27 #include "ash/shell.h" | 27 #include "ash/shell.h" |
| 28 #include "ash/wm/visibility_controller.h" | 28 #include "ash/wm/visibility_controller.h" |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 using content::RenderViewHost; |
| 31 using content::RenderWidgetHostView; | 32 using content::RenderWidgetHostView; |
| 32 using content::WebContents; | 33 using content::WebContents; |
| 33 | 34 |
| 34 namespace { | 35 namespace { |
| 35 | 36 |
| 36 // Listens to all mouse drag events during a drag and drop and sends them to | 37 // Listens to all mouse drag events during a drag and drop and sends them to |
| 37 // the renderer. | 38 // the renderer. |
| 38 class WebDragSourceAura : public MessageLoopForUI::Observer { | 39 class WebDragSourceAura : public MessageLoopForUI::Observer { |
| 39 public: | 40 public: |
| 40 explicit WebDragSourceAura(NativeTabContentsViewAura* view) | 41 explicit WebDragSourceAura(NativeTabContentsViewAura* view) |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // default if they are created with no parent. Pending oshima's | 174 // default if they are created with no parent. Pending oshima's |
| 174 // change to reflect Widget types onto a ViewProp. | 175 // change to reflect Widget types onto a ViewProp. |
| 175 GetWidget()->Hide(); | 176 GetWidget()->Hide(); |
| 176 } | 177 } |
| 177 | 178 |
| 178 void NativeTabContentsViewAura::Unparent() { | 179 void NativeTabContentsViewAura::Unparent() { |
| 179 // Nothing to do. | 180 // Nothing to do. |
| 180 } | 181 } |
| 181 | 182 |
| 182 RenderWidgetHostView* NativeTabContentsViewAura::CreateRenderWidgetHostView( | 183 RenderWidgetHostView* NativeTabContentsViewAura::CreateRenderWidgetHostView( |
| 183 RenderWidgetHost* render_widget_host) { | 184 content::RenderWidgetHost* render_widget_host) { |
| 184 RenderWidgetHostView* view = | 185 RenderWidgetHostView* view = |
| 185 RenderWidgetHostView::CreateViewForWidget(render_widget_host); | 186 RenderWidgetHostView::CreateViewForWidget(render_widget_host); |
| 186 | 187 |
| 187 view->InitAsChild(NULL); | 188 view->InitAsChild(NULL); |
| 188 GetNativeView()->AddChild(view->GetNativeView()); | 189 GetNativeView()->AddChild(view->GetNativeView()); |
| 189 view->Show(); | 190 view->Show(); |
| 190 | 191 |
| 191 // We listen to drag drop events in the newly created view's window. | 192 // We listen to drag drop events in the newly created view's window. |
| 192 aura::client::SetDragDropDelegate(view->GetNativeView(), this); | 193 aura::client::SetDragDropDelegate(view->GetNativeView(), this); |
| 193 return view; | 194 return view; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 } | 337 } |
| 337 | 338 |
| 338 //////////////////////////////////////////////////////////////////////////////// | 339 //////////////////////////////////////////////////////////////////////////////// |
| 339 // NativeTabContentsView, public: | 340 // NativeTabContentsView, public: |
| 340 | 341 |
| 341 // static | 342 // static |
| 342 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( | 343 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( |
| 343 internal::NativeTabContentsViewDelegate* delegate) { | 344 internal::NativeTabContentsViewDelegate* delegate) { |
| 344 return new NativeTabContentsViewAura(delegate); | 345 return new NativeTabContentsViewAura(delegate); |
| 345 } | 346 } |
| OLD | NEW |