Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: content/plugin/webplugin_delegate_stub.cc

Issue 7812020: Moved the following IPC messages used by the chrome NPAPI plugin installer out of content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/plugin/webplugin_delegate_stub.h" 5 #include "content/plugin/webplugin_delegate_stub.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/string_number_conversions.h"
10 #include "content/common/content_client.h" 11 #include "content/common/content_client.h"
12 #include "content/common/content_constants.h"
11 #include "content/common/content_switches.h" 13 #include "content/common/content_switches.h"
12 #include "content/common/plugin_messages.h" 14 #include "content/common/plugin_messages.h"
13 #include "content/plugin/npobject_stub.h" 15 #include "content/plugin/npobject_stub.h"
14 #include "content/plugin/plugin_channel.h" 16 #include "content/plugin/plugin_channel.h"
15 #include "content/plugin/plugin_thread.h" 17 #include "content/plugin/plugin_thread.h"
16 #include "content/plugin/webplugin_proxy.h" 18 #include "content/plugin/webplugin_proxy.h"
17 #include "third_party/npapi/bindings/npapi.h" 19 #include "third_party/npapi/bindings/npapi.h"
18 #include "third_party/npapi/bindings/npruntime.h" 20 #include "third_party/npapi/bindings/npruntime.h"
19 #include "skia/ext/platform_device.h" 21 #include "skia/ext/platform_device.h"
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 IPC_MESSAGE_HANDLER(PluginMsg_WindowFrameChanged, OnWindowFrameChanged) 117 IPC_MESSAGE_HANDLER(PluginMsg_WindowFrameChanged, OnWindowFrameChanged)
116 IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionCompleted, 118 IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionCompleted,
117 OnImeCompositionCompleted) 119 OnImeCompositionCompleted)
118 #endif 120 #endif
119 IPC_MESSAGE_HANDLER(PluginMsg_DidReceiveManualResponse, 121 IPC_MESSAGE_HANDLER(PluginMsg_DidReceiveManualResponse,
120 OnDidReceiveManualResponse) 122 OnDidReceiveManualResponse)
121 IPC_MESSAGE_HANDLER(PluginMsg_DidReceiveManualData, OnDidReceiveManualData) 123 IPC_MESSAGE_HANDLER(PluginMsg_DidReceiveManualData, OnDidReceiveManualData)
122 IPC_MESSAGE_HANDLER(PluginMsg_DidFinishManualLoading, 124 IPC_MESSAGE_HANDLER(PluginMsg_DidFinishManualLoading,
123 OnDidFinishManualLoading) 125 OnDidFinishManualLoading)
124 IPC_MESSAGE_HANDLER(PluginMsg_DidManualLoadFail, OnDidManualLoadFail) 126 IPC_MESSAGE_HANDLER(PluginMsg_DidManualLoadFail, OnDidManualLoadFail)
125 IPC_MESSAGE_HANDLER(PluginMsg_InstallMissingPlugin, OnInstallMissingPlugin)
126 IPC_MESSAGE_HANDLER(PluginMsg_HandleURLRequestReply, 127 IPC_MESSAGE_HANDLER(PluginMsg_HandleURLRequestReply,
127 OnHandleURLRequestReply) 128 OnHandleURLRequestReply)
128 IPC_MESSAGE_HANDLER(PluginMsg_HTTPRangeRequestReply, 129 IPC_MESSAGE_HANDLER(PluginMsg_HTTPRangeRequestReply,
129 OnHTTPRangeRequestReply) 130 OnHTTPRangeRequestReply)
130 #if defined(OS_MACOSX) 131 #if defined(OS_MACOSX)
131 IPC_MESSAGE_HANDLER(PluginMsg_SetFakeAcceleratedSurfaceWindowHandle, 132 IPC_MESSAGE_HANDLER(PluginMsg_SetFakeAcceleratedSurfaceWindowHandle,
132 OnSetFakeAcceleratedSurfaceWindowHandle) 133 OnSetFakeAcceleratedSurfaceWindowHandle)
133 #endif 134 #endif
134 IPC_MESSAGE_UNHANDLED(handled = false) 135 IPC_MESSAGE_UNHANDLED(handled = false)
135 IPC_END_MESSAGE_MAP() 136 IPC_END_MESSAGE_MAP()
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // params.containing_window, &parent)); 173 // params.containing_window, &parent));
173 #endif 174 #endif
174 175
175 webplugin_ = new WebPluginProxy( 176 webplugin_ = new WebPluginProxy(
176 channel_, instance_id_, page_url_, params.containing_window, 177 channel_, instance_id_, page_url_, params.containing_window,
177 params.host_render_view_routing_id); 178 params.host_render_view_routing_id);
178 delegate_ = webkit::npapi::WebPluginDelegateImpl::Create( 179 delegate_ = webkit::npapi::WebPluginDelegateImpl::Create(
179 path, mime_type_, parent); 180 path, mime_type_, parent);
180 if (delegate_) { 181 if (delegate_) {
181 webplugin_->set_delegate(delegate_); 182 webplugin_->set_delegate(delegate_);
183 std::vector<std::string> arg_names = params.arg_names;
184 std::vector<std::string> arg_values = params.arg_values;
185
186 // Add the renderer process id and Render view routing id to the list of
jam 2011/08/31 17:34:42 we shouldn't have to expose this information to al
ananta 2011/08/31 20:18:14 Done.
187 // parameters passed to the plugin.
188 arg_names.push_back(content::kPluginRenderViewId);
189 arg_values.push_back(base::IntToString(
190 params.host_render_view_routing_id));
191
192 arg_names.push_back(content::kPluginRenderProcessId);
193 arg_values.push_back(base::IntToString(channel_->renderer_id()));
194
182 *result = delegate_->Initialize(params.url, 195 *result = delegate_->Initialize(params.url,
183 params.arg_names, 196 arg_names,
184 params.arg_values, 197 arg_values,
185 webplugin_, 198 webplugin_,
186 params.load_manually); 199 params.load_manually);
187 } 200 }
188 } 201 }
189 202
190 void WebPluginDelegateStub::OnWillSendRequest(int id, const GURL& url, 203 void WebPluginDelegateStub::OnWillSendRequest(int id, const GURL& url,
191 int http_status_code) { 204 int http_status_code) {
192 WebPluginResourceClient* client = webplugin_->GetResourceClient(id); 205 WebPluginResourceClient* client = webplugin_->GetResourceClient(id);
193 if (!client) 206 if (!client)
194 return; 207 return;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 369 }
357 370
358 void WebPluginDelegateStub::OnDidFinishManualLoading() { 371 void WebPluginDelegateStub::OnDidFinishManualLoading() {
359 delegate_->DidFinishManualLoading(); 372 delegate_->DidFinishManualLoading();
360 } 373 }
361 374
362 void WebPluginDelegateStub::OnDidManualLoadFail() { 375 void WebPluginDelegateStub::OnDidManualLoadFail() {
363 delegate_->DidManualLoadFail(); 376 delegate_->DidManualLoadFail();
364 } 377 }
365 378
366 void WebPluginDelegateStub::OnInstallMissingPlugin() {
367 delegate_->InstallMissingPlugin();
368 }
369
370 void WebPluginDelegateStub::OnHandleURLRequestReply( 379 void WebPluginDelegateStub::OnHandleURLRequestReply(
371 unsigned long resource_id, const GURL& url, int notify_id) { 380 unsigned long resource_id, const GURL& url, int notify_id) {
372 WebPluginResourceClient* resource_client = 381 WebPluginResourceClient* resource_client =
373 delegate_->CreateResourceClient(resource_id, url, notify_id); 382 delegate_->CreateResourceClient(resource_id, url, notify_id);
374 webplugin_->OnResourceCreated(resource_id, resource_client); 383 webplugin_->OnResourceCreated(resource_id, resource_client);
375 } 384 }
376 385
377 void WebPluginDelegateStub::OnHTTPRangeRequestReply( 386 void WebPluginDelegateStub::OnHTTPRangeRequestReply(
378 unsigned long resource_id, int range_request_id) { 387 unsigned long resource_id, int range_request_id) {
379 WebPluginResourceClient* resource_client = 388 WebPluginResourceClient* resource_client =
380 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); 389 delegate_->CreateSeekableResourceClient(resource_id, range_request_id);
381 webplugin_->OnResourceCreated(resource_id, resource_client); 390 webplugin_->OnResourceCreated(resource_id, resource_client);
382 } 391 }
383 392
384 #if defined(OS_MACOSX) 393 #if defined(OS_MACOSX)
385 void WebPluginDelegateStub::OnSetFakeAcceleratedSurfaceWindowHandle( 394 void WebPluginDelegateStub::OnSetFakeAcceleratedSurfaceWindowHandle(
386 gfx::PluginWindowHandle window) { 395 gfx::PluginWindowHandle window) {
387 delegate_->set_windowed_handle(window); 396 delegate_->set_windowed_handle(window);
388 } 397 }
389 #endif 398 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698