| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_contents/tab_contents_view.h" | 5 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_process_host.h" | 7 #include "chrome/browser/renderer_host/render_process_host.h" |
| 8 #include "chrome/browser/renderer_host/render_view_host.h" | 8 #include "chrome/browser/renderer_host/render_view_host.h" |
| 9 #include "chrome/browser/renderer_host/render_widget_host.h" | 9 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 10 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 10 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
| 11 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 11 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 12 #include "chrome/browser/tab_contents/tab_contents.h" | 12 #include "chrome/browser/tab_contents/tab_contents.h" |
| 13 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 13 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 14 | 14 |
| 15 TabContentsView::TabContentsView(TabContents* tab_contents) | 15 TabContentsView::TabContentsView(TabContents* tab_contents) |
| 16 : tab_contents_(tab_contents) { | 16 : tab_contents_(tab_contents) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 TabContentsView::~TabContentsView() {} |
| 20 |
| 19 void TabContentsView::RenderWidgetHostDestroyed(RenderWidgetHost* host) { | 21 void TabContentsView::RenderWidgetHostDestroyed(RenderWidgetHost* host) { |
| 20 if (host->view()) | 22 if (host->view()) |
| 21 host->view()->WillDestroyRenderWidget(host); | 23 host->view()->WillDestroyRenderWidget(host); |
| 22 delegate_view_helper_.RenderWidgetHostDestroyed(host); | 24 delegate_view_helper_.RenderWidgetHostDestroyed(host); |
| 23 } | 25 } |
| 24 | 26 |
| 25 void TabContentsView::RenderViewCreated(RenderViewHost* host) { | 27 void TabContentsView::RenderViewCreated(RenderViewHost* host) { |
| 26 // Default implementation does nothing. Platforms may override. | 28 // Default implementation does nothing. Platforms may override. |
| 27 } | 29 } |
| 28 | 30 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 return tab_contents_->delegate() && | 98 return tab_contents_->delegate() && |
| 97 tab_contents_->delegate()->PreHandleKeyboardEvent( | 99 tab_contents_->delegate()->PreHandleKeyboardEvent( |
| 98 event, is_keyboard_shortcut); | 100 event, is_keyboard_shortcut); |
| 99 } | 101 } |
| 100 | 102 |
| 101 void TabContentsView::UpdatePreferredSize(const gfx::Size& pref_size) { | 103 void TabContentsView::UpdatePreferredSize(const gfx::Size& pref_size) { |
| 102 if (tab_contents_->delegate()) | 104 if (tab_contents_->delegate()) |
| 103 tab_contents_->delegate()->UpdatePreferredSize(pref_size); | 105 tab_contents_->delegate()->UpdatePreferredSize(pref_size); |
| 104 } | 106 } |
| 105 | 107 |
| 108 bool TabContentsView::IsDoingDrag() const { |
| 109 return false; |
| 110 } |
| 111 |
| 112 bool TabContentsView::IsEventTracking() const { |
| 113 return false; |
| 114 } |
| 115 |
| 116 bool TabContentsView::ShouldDrawDropShadow() { |
| 117 return false; |
| 118 } |
| 119 |
| 120 TabContentsView::TabContentsView() {} |
| 121 |
| 106 void TabContentsView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 122 void TabContentsView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 107 if (tab_contents_->delegate()) | 123 if (tab_contents_->delegate()) |
| 108 tab_contents_->delegate()->HandleKeyboardEvent(event); | 124 tab_contents_->delegate()->HandleKeyboardEvent(event); |
| 109 } | 125 } |
| 110 | 126 |
| 111 void TabContentsView::HandleMouseUp() { | 127 void TabContentsView::HandleMouseUp() { |
| 112 if (tab_contents_->delegate()) | 128 if (tab_contents_->delegate()) |
| 113 tab_contents_->delegate()->HandleMouseUp(); | 129 tab_contents_->delegate()->HandleMouseUp(); |
| 114 } | 130 } |
| 115 | 131 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 141 } | 157 } |
| 142 | 158 |
| 143 void TabContentsView::ShowCreatedFullscreenWidgetInternal( | 159 void TabContentsView::ShowCreatedFullscreenWidgetInternal( |
| 144 RenderWidgetHostView* widget_host_view) { | 160 RenderWidgetHostView* widget_host_view) { |
| 145 if (tab_contents_->delegate()) | 161 if (tab_contents_->delegate()) |
| 146 tab_contents_->delegate()->RenderWidgetShowing(); | 162 tab_contents_->delegate()->RenderWidgetShowing(); |
| 147 | 163 |
| 148 widget_host_view->InitAsFullscreen(tab_contents_->GetRenderWidgetHostView()); | 164 widget_host_view->InitAsFullscreen(tab_contents_->GetRenderWidgetHostView()); |
| 149 widget_host_view->GetRenderWidgetHost()->Init(); | 165 widget_host_view->GetRenderWidgetHost()->Init(); |
| 150 } | 166 } |
| OLD | NEW |