OLD | NEW |
1 // Copyright (c) 2009 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/plugin/webplugin_delegate_stub.h" | 5 #include "chrome/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 "chrome/common/child_process_logging.h" | 10 #include "chrome/common/child_process_logging.h" |
11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 for (int i = 0; i < argc; ++i) { | 134 for (int i = 0; i < argc; ++i) { |
135 argn[i] = const_cast<char*>(params.arg_names[i].c_str()); | 135 argn[i] = const_cast<char*>(params.arg_names[i].c_str()); |
136 argv[i] = const_cast<char*>(params.arg_values[i].c_str()); | 136 argv[i] = const_cast<char*>(params.arg_values[i].c_str()); |
137 } | 137 } |
138 | 138 |
139 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 139 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
140 FilePath path = FilePath::FromWStringHack( | 140 FilePath path = FilePath::FromWStringHack( |
141 command_line.GetSwitchValue(switches::kPluginPath)); | 141 command_line.GetSwitchValue(switches::kPluginPath)); |
142 | 142 |
143 | 143 |
144 gfx::PluginWindowHandle parent = 0; | 144 gfx::PluginWindowHandle parent = NULL; |
145 #if defined(OS_WIN) | 145 #if defined(OS_WIN) |
146 parent = gfx::NativeViewFromId(params.containing_window); | 146 parent = gfx::NativeViewFromId(params.containing_window); |
147 #elif defined(OS_LINUX) | 147 #elif defined(OS_LINUX) |
148 PluginThread::current()->Send(new PluginProcessHostMsg_MapNativeViewId( | 148 PluginThread::current()->Send(new PluginProcessHostMsg_MapNativeViewId( |
149 params.containing_window, &parent)); | 149 params.containing_window, &parent)); |
150 #endif | 150 #endif |
151 delegate_ = WebPluginDelegate::Create(path, mime_type_, parent); | 151 delegate_ = WebPluginDelegate::Create(path, mime_type_, parent); |
152 | 152 |
153 if (delegate_) { | 153 if (delegate_) { |
154 webplugin_ = new WebPluginProxy( | 154 webplugin_ = new WebPluginProxy( |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 void WebPluginDelegateStub::OnHandleURLRequestReply( | 368 void WebPluginDelegateStub::OnHandleURLRequestReply( |
369 const PluginMsg_URLRequestReply_Params& params) { | 369 const PluginMsg_URLRequestReply_Params& params) { |
370 WebPluginResourceClient* resource_client = | 370 WebPluginResourceClient* resource_client = |
371 delegate_->CreateResourceClient(params.resource_id, params.url, | 371 delegate_->CreateResourceClient(params.resource_id, params.url, |
372 params.notify_needed, | 372 params.notify_needed, |
373 params.notify_data, | 373 params.notify_data, |
374 params.stream); | 374 params.stream); |
375 webplugin_->OnResourceCreated(params.resource_id, resource_client); | 375 webplugin_->OnResourceCreated(params.resource_id, resource_client); |
376 } | 376 } |
OLD | NEW |