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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 process_->Release(routing_id_); | 114 process_->Release(routing_id_); |
115 } | 115 } |
116 | 116 |
117 gfx::NativeViewId RenderWidgetHost::GetNativeViewId() { | 117 gfx::NativeViewId RenderWidgetHost::GetNativeViewId() { |
118 if (view_) | 118 if (view_) |
119 return gfx::IdFromNativeView(view_->GetNativeView()); | 119 return gfx::IdFromNativeView(view_->GetNativeView()); |
120 return 0; | 120 return 0; |
121 } | 121 } |
122 | 122 |
| 123 gfx::PluginWindowHandle RenderWidgetHost::GetCompositingSurface() { |
| 124 if (view_) |
| 125 return view_->GetCompositingSurface(); |
| 126 return gfx::kNullPluginWindow; |
| 127 } |
| 128 |
123 bool RenderWidgetHost::PreHandleKeyboardEvent( | 129 bool RenderWidgetHost::PreHandleKeyboardEvent( |
124 const NativeWebKeyboardEvent& event, | 130 const NativeWebKeyboardEvent& event, |
125 bool* is_keyboard_shortcut) { | 131 bool* is_keyboard_shortcut) { |
126 return false; | 132 return false; |
127 } | 133 } |
128 | 134 |
129 void RenderWidgetHost::Init() { | 135 void RenderWidgetHost::Init() { |
130 DCHECK(process_->HasConnection()); | 136 DCHECK(process_->HasConnection()); |
131 | 137 |
132 renderer_initialized_ = true; | 138 renderer_initialized_ = true; |
133 | 139 |
134 // Send the ack along with the information on placement. | 140 // Send the ack along with the information on placement. |
135 Send(new ViewMsg_CreatingNew_ACK(routing_id_, GetNativeViewId())); | 141 Send(new ViewMsg_CreatingNew_ACK( |
| 142 routing_id_, GetNativeViewId(), GetCompositingSurface())); |
136 WasResized(); | 143 WasResized(); |
137 } | 144 } |
138 | 145 |
139 void RenderWidgetHost::Shutdown() { | 146 void RenderWidgetHost::Shutdown() { |
140 if (process_->HasConnection()) { | 147 if (process_->HasConnection()) { |
141 // Tell the renderer object to close. | 148 // Tell the renderer object to close. |
142 process_->ReportExpectingClose(routing_id_); | 149 process_->ReportExpectingClose(routing_id_); |
143 bool rv = Send(new ViewMsg_Close(routing_id_)); | 150 bool rv = Send(new ViewMsg_Close(routing_id_)); |
144 DCHECK(rv); | 151 DCHECK(rv); |
145 } | 152 } |
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 view_->CreatePluginContainer(deferred_plugin_handles_[i]); | 1287 view_->CreatePluginContainer(deferred_plugin_handles_[i]); |
1281 #endif | 1288 #endif |
1282 } | 1289 } |
1283 | 1290 |
1284 deferred_plugin_handles_.clear(); | 1291 deferred_plugin_handles_.clear(); |
1285 } | 1292 } |
1286 | 1293 |
1287 void RenderWidgetHost::StartUserGesture() { | 1294 void RenderWidgetHost::StartUserGesture() { |
1288 OnUserGesture(); | 1295 OnUserGesture(); |
1289 } | 1296 } |
OLD | NEW |