| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_widget_host.h" | 8 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 9 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 9 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 void TabContentsView::ShowCreatedWidget(int route_id, | 54 void TabContentsView::ShowCreatedWidget(int route_id, |
| 55 const gfx::Rect& initial_pos) { | 55 const gfx::Rect& initial_pos) { |
| 56 RenderWidgetHostView* widget_host_view = | 56 RenderWidgetHostView* widget_host_view = |
| 57 delegate_view_helper_.GetCreatedWidget(route_id); | 57 delegate_view_helper_.GetCreatedWidget(route_id); |
| 58 ShowCreatedWidgetInternal(widget_host_view, initial_pos); | 58 ShowCreatedWidgetInternal(widget_host_view, initial_pos); |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool TabContentsView::IsReservedAccelerator( | 61 bool TabContentsView::PreHandleKeyboardEvent( |
| 62 const NativeWebKeyboardEvent& event) { | 62 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
| 63 return tab_contents()->delegate() && | 63 return tab_contents_->delegate() && |
| 64 tab_contents()->delegate()->IsReservedAccelerator(event); | 64 tab_contents_->delegate()->PreHandleKeyboardEvent( |
| 65 event, is_keyboard_shortcut); |
| 66 } |
| 67 |
| 68 void TabContentsView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 69 if (tab_contents_->delegate()) |
| 70 tab_contents_->delegate()->HandleKeyboardEvent(event); |
| 65 } | 71 } |
| 66 | 72 |
| 67 RenderWidgetHostView* TabContentsView::CreateNewWidgetInternal( | 73 RenderWidgetHostView* TabContentsView::CreateNewWidgetInternal( |
| 68 int route_id, bool activatable) { | 74 int route_id, bool activatable) { |
| 69 return delegate_view_helper_.CreateNewWidget(route_id, activatable, | 75 return delegate_view_helper_.CreateNewWidget(route_id, activatable, |
| 70 tab_contents()->render_view_host()->process()); | 76 tab_contents()->render_view_host()->process()); |
| 71 } | 77 } |
| 72 | 78 |
| 73 void TabContentsView::ShowCreatedWidgetInternal( | 79 void TabContentsView::ShowCreatedWidgetInternal( |
| 74 RenderWidgetHostView* widget_host_view, const gfx::Rect& initial_pos) { | 80 RenderWidgetHostView* widget_host_view, const gfx::Rect& initial_pos) { |
| 75 if (tab_contents_->delegate()) | 81 if (tab_contents_->delegate()) |
| 76 tab_contents_->delegate()->RenderWidgetShowing(); | 82 tab_contents_->delegate()->RenderWidgetShowing(); |
| 77 | 83 |
| 78 widget_host_view->InitAsPopup(tab_contents_->render_widget_host_view(), | 84 widget_host_view->InitAsPopup(tab_contents_->render_widget_host_view(), |
| 79 initial_pos); | 85 initial_pos); |
| 80 widget_host_view->GetRenderWidgetHost()->Init(); | 86 widget_host_view->GetRenderWidgetHost()->Init(); |
| 81 } | 87 } |
| OLD | NEW |