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 "content/browser/renderer_host/render_widget_host.h" | 5 #include "content/browser/renderer_host/render_widget_host.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 process_->Release(routing_id_); | 116 process_->Release(routing_id_); |
117 } | 117 } |
118 | 118 |
119 gfx::NativeViewId RenderWidgetHost::GetNativeViewId() { | 119 gfx::NativeViewId RenderWidgetHost::GetNativeViewId() { |
120 if (view_) | 120 if (view_) |
121 return gfx::IdFromNativeView(view_->GetNativeView()); | 121 return gfx::IdFromNativeView(view_->GetNativeView()); |
122 return 0; | 122 return 0; |
123 } | 123 } |
124 | 124 |
| 125 gfx::PluginWindowHandle RenderWidgetHost::GetCompositingSurface() { |
| 126 if (view_) |
| 127 return view_->GetCompositingSurface(); |
| 128 return gfx::kNullPluginWindow; |
| 129 } |
| 130 |
125 bool RenderWidgetHost::PreHandleKeyboardEvent( | 131 bool RenderWidgetHost::PreHandleKeyboardEvent( |
126 const NativeWebKeyboardEvent& event, | 132 const NativeWebKeyboardEvent& event, |
127 bool* is_keyboard_shortcut) { | 133 bool* is_keyboard_shortcut) { |
128 return false; | 134 return false; |
129 } | 135 } |
130 | 136 |
131 void RenderWidgetHost::Init() { | 137 void RenderWidgetHost::Init() { |
132 DCHECK(process_->HasConnection()); | 138 DCHECK(process_->HasConnection()); |
133 | 139 |
134 renderer_initialized_ = true; | 140 renderer_initialized_ = true; |
135 | 141 |
136 // Send the ack along with the information on placement. | 142 // Send the ack along with the information on placement. |
137 Send(new ViewMsg_CreatingNew_ACK(routing_id_, GetNativeViewId())); | 143 Send(new ViewMsg_CreatingNew_ACK( |
| 144 routing_id_, GetNativeViewId(), GetCompositingSurface())); |
138 WasResized(); | 145 WasResized(); |
139 } | 146 } |
140 | 147 |
141 void RenderWidgetHost::Shutdown() { | 148 void RenderWidgetHost::Shutdown() { |
142 if (process_->HasConnection()) { | 149 if (process_->HasConnection()) { |
143 // Tell the renderer object to close. | 150 // Tell the renderer object to close. |
144 process_->ReportExpectingClose(routing_id_); | 151 process_->ReportExpectingClose(routing_id_); |
145 bool rv = Send(new ViewMsg_Close(routing_id_)); | 152 bool rv = Send(new ViewMsg_Close(routing_id_)); |
146 DCHECK(rv); | 153 DCHECK(rv); |
147 } | 154 } |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 view_->CreatePluginContainer(deferred_plugin_handles_[i]); | 1305 view_->CreatePluginContainer(deferred_plugin_handles_[i]); |
1299 #endif | 1306 #endif |
1300 } | 1307 } |
1301 | 1308 |
1302 deferred_plugin_handles_.clear(); | 1309 deferred_plugin_handles_.clear(); |
1303 } | 1310 } |
1304 | 1311 |
1305 void RenderWidgetHost::StartUserGesture() { | 1312 void RenderWidgetHost::StartUserGesture() { |
1306 OnUserGesture(); | 1313 OnUserGesture(); |
1307 } | 1314 } |
OLD | NEW |