OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // been released, or if the channel to the proxy is closed. | 310 // been released, or if the channel to the proxy is closed. |
311 NPObjectStub* scriptable_stub = new NPObjectStub( | 311 NPObjectStub* scriptable_stub = new NPObjectStub( |
312 object, channel_.get(), *route_id, | 312 object, channel_.get(), *route_id, |
313 webplugin_->host_render_view_routing_id(), page_url_); | 313 webplugin_->host_render_view_routing_id(), page_url_); |
314 plugin_scriptable_object_ = scriptable_stub->AsWeakPtr(); | 314 plugin_scriptable_object_ = scriptable_stub->AsWeakPtr(); |
315 | 315 |
316 // Release ref added by GetPluginScriptableObject (our stub holds its own). | 316 // Release ref added by GetPluginScriptableObject (our stub holds its own). |
317 WebBindings::releaseObject(object); | 317 WebBindings::releaseObject(object); |
318 } | 318 } |
319 | 319 |
320 void WebPluginDelegateStub::OnGetFormValue(string16* value, bool* success) { | 320 void WebPluginDelegateStub::OnGetFormValue(base::string16* value, |
| 321 bool* success) { |
321 *success = false; | 322 *success = false; |
322 if (!delegate_) | 323 if (!delegate_) |
323 return; | 324 return; |
324 *success = delegate_->GetFormValue(value); | 325 *success = delegate_->GetFormValue(value); |
325 } | 326 } |
326 | 327 |
327 void WebPluginDelegateStub::OnSendJavaScriptStream(const GURL& url, | 328 void WebPluginDelegateStub::OnSendJavaScriptStream(const GURL& url, |
328 const std::string& result, | 329 const std::string& result, |
329 bool success, | 330 bool success, |
330 int notify_id) { | 331 int notify_id) { |
331 delegate_->SendJavaScriptStream(url, result, success, notify_id); | 332 delegate_->SendJavaScriptStream(url, result, success, notify_id); |
332 } | 333 } |
333 | 334 |
334 void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) { | 335 void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) { |
335 if (delegate_) | 336 if (delegate_) |
336 delegate_->SetContentAreaHasFocus(has_focus); | 337 delegate_->SetContentAreaHasFocus(has_focus); |
337 } | 338 } |
338 | 339 |
339 #if defined(OS_WIN) && !defined(USE_AURA) | 340 #if defined(OS_WIN) && !defined(USE_AURA) |
340 void WebPluginDelegateStub::OnImeCompositionUpdated( | 341 void WebPluginDelegateStub::OnImeCompositionUpdated( |
341 const string16& text, | 342 const base::string16& text, |
342 const std::vector<int>& clauses, | 343 const std::vector<int>& clauses, |
343 const std::vector<int>& target, | 344 const std::vector<int>& target, |
344 int cursor_position) { | 345 int cursor_position) { |
345 if (delegate_) | 346 if (delegate_) |
346 delegate_->ImeCompositionUpdated(text, clauses, target, cursor_position); | 347 delegate_->ImeCompositionUpdated(text, clauses, target, cursor_position); |
347 #if defined(OS_WIN) && !defined(USE_AURA) | 348 #if defined(OS_WIN) && !defined(USE_AURA) |
348 webplugin_->UpdateIMEStatus(); | 349 webplugin_->UpdateIMEStatus(); |
349 #endif | 350 #endif |
350 } | 351 } |
351 | 352 |
352 void WebPluginDelegateStub::OnImeCompositionCompleted(const string16& text) { | 353 void WebPluginDelegateStub::OnImeCompositionCompleted( |
| 354 const base::string16& text) { |
353 if (delegate_) | 355 if (delegate_) |
354 delegate_->ImeCompositionCompleted(text); | 356 delegate_->ImeCompositionCompleted(text); |
355 } | 357 } |
356 #endif | 358 #endif |
357 | 359 |
358 #if defined(OS_MACOSX) | 360 #if defined(OS_MACOSX) |
359 void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { | 361 void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { |
360 if (delegate_) | 362 if (delegate_) |
361 delegate_->SetWindowHasFocus(has_focus); | 363 delegate_->SetWindowHasFocus(has_focus); |
362 } | 364 } |
(...skipping 12 matching lines...) Expand all Loading... |
375 delegate_->SetWindowHasFocus(has_focus); | 377 delegate_->SetWindowHasFocus(has_focus); |
376 } | 378 } |
377 } | 379 } |
378 | 380 |
379 void WebPluginDelegateStub::OnWindowFrameChanged(const gfx::Rect& window_frame, | 381 void WebPluginDelegateStub::OnWindowFrameChanged(const gfx::Rect& window_frame, |
380 const gfx::Rect& view_frame) { | 382 const gfx::Rect& view_frame) { |
381 if (delegate_) | 383 if (delegate_) |
382 delegate_->WindowFrameChanged(window_frame, view_frame); | 384 delegate_->WindowFrameChanged(window_frame, view_frame); |
383 } | 385 } |
384 | 386 |
385 void WebPluginDelegateStub::OnImeCompositionCompleted(const string16& text) { | 387 void WebPluginDelegateStub::OnImeCompositionCompleted( |
| 388 const base::string16& text) { |
386 if (delegate_) | 389 if (delegate_) |
387 delegate_->ImeCompositionCompleted(text); | 390 delegate_->ImeCompositionCompleted(text); |
388 } | 391 } |
389 #endif // OS_MACOSX | 392 #endif // OS_MACOSX |
390 | 393 |
391 void WebPluginDelegateStub::OnDidReceiveManualResponse( | 394 void WebPluginDelegateStub::OnDidReceiveManualResponse( |
392 const GURL& url, | 395 const GURL& url, |
393 const PluginMsg_DidReceiveResponseParams& params) { | 396 const PluginMsg_DidReceiveResponseParams& params) { |
394 delegate_->DidReceiveManualResponse(url, params.mime_type, params.headers, | 397 delegate_->DidReceiveManualResponse(url, params.mime_type, params.headers, |
395 params.expected_length, | 398 params.expected_length, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 data, | 441 data, |
439 static_cast<unsigned int>(params.post_data.size()), | 442 static_cast<unsigned int>(params.post_data.size()), |
440 params.referrer, | 443 params.referrer, |
441 params.notify_redirect, | 444 params.notify_redirect, |
442 params.is_plugin_src_load, | 445 params.is_plugin_src_load, |
443 channel_->renderer_id(), | 446 channel_->renderer_id(), |
444 params.render_view_id); | 447 params.render_view_id); |
445 } | 448 } |
446 | 449 |
447 } // namespace content | 450 } // namespace content |
OLD | NEW |