OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 330 } |
331 | 331 |
332 void WebPluginDelegateStub::OnSendJavaScriptStream(const GURL& url, | 332 void WebPluginDelegateStub::OnSendJavaScriptStream(const GURL& url, |
333 const std::string& result, | 333 const std::string& result, |
334 bool success, | 334 bool success, |
335 int notify_id) { | 335 int notify_id) { |
336 delegate_->SendJavaScriptStream(url, result, success, notify_id); | 336 delegate_->SendJavaScriptStream(url, result, success, notify_id); |
337 } | 337 } |
338 | 338 |
339 void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) { | 339 void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) { |
340 delegate_->SetContentAreaHasFocus(has_focus); | 340 if (delegate_) |
| 341 delegate_->SetContentAreaHasFocus(has_focus); |
341 } | 342 } |
342 | 343 |
343 #if defined(OS_MACOSX) | 344 #if defined(OS_MACOSX) |
344 void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { | 345 void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { |
345 delegate_->SetWindowHasFocus(has_focus); | 346 if (delegate_) |
| 347 delegate_->SetWindowHasFocus(has_focus); |
346 } | 348 } |
347 | 349 |
348 void WebPluginDelegateStub::OnContainerHidden() { | 350 void WebPluginDelegateStub::OnContainerHidden() { |
349 delegate_->SetContainerVisibility(false); | 351 if (delegate_) |
| 352 delegate_->SetContainerVisibility(false); |
350 } | 353 } |
351 | 354 |
352 void WebPluginDelegateStub::OnContainerShown(gfx::Rect window_frame, | 355 void WebPluginDelegateStub::OnContainerShown(gfx::Rect window_frame, |
353 gfx::Rect view_frame, | 356 gfx::Rect view_frame, |
354 bool has_focus) { | 357 bool has_focus) { |
355 delegate_->WindowFrameChanged(window_frame, view_frame); | 358 if (delegate_) { |
356 delegate_->SetContainerVisibility(true); | 359 delegate_->WindowFrameChanged(window_frame, view_frame); |
357 delegate_->SetWindowHasFocus(has_focus); | 360 delegate_->SetContainerVisibility(true); |
| 361 delegate_->SetWindowHasFocus(has_focus); |
| 362 } |
358 } | 363 } |
359 | 364 |
360 void WebPluginDelegateStub::OnWindowFrameChanged(const gfx::Rect& window_frame, | 365 void WebPluginDelegateStub::OnWindowFrameChanged(const gfx::Rect& window_frame, |
361 const gfx::Rect& view_frame) { | 366 const gfx::Rect& view_frame) { |
362 delegate_->WindowFrameChanged(window_frame, view_frame); | 367 if (delegate_) |
| 368 delegate_->WindowFrameChanged(window_frame, view_frame); |
363 } | 369 } |
364 #endif // OS_MACOSX | 370 #endif // OS_MACOSX |
365 | 371 |
366 void WebPluginDelegateStub::OnDidReceiveManualResponse( | 372 void WebPluginDelegateStub::OnDidReceiveManualResponse( |
367 const GURL& url, | 373 const GURL& url, |
368 const PluginMsg_DidReceiveResponseParams& params) { | 374 const PluginMsg_DidReceiveResponseParams& params) { |
369 delegate_->DidReceiveManualResponse(url, params.mime_type, params.headers, | 375 delegate_->DidReceiveManualResponse(url, params.mime_type, params.headers, |
370 params.expected_length, | 376 params.expected_length, |
371 params.last_modified); | 377 params.last_modified); |
372 } | 378 } |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 webplugin_->OnResourceCreated(resource_id, resource_client); | 463 webplugin_->OnResourceCreated(resource_id, resource_client); |
458 } | 464 } |
459 | 465 |
460 #if defined(OS_MACOSX) | 466 #if defined(OS_MACOSX) |
461 void WebPluginDelegateStub::OnSetFakeAcceleratedSurfaceWindowHandle( | 467 void WebPluginDelegateStub::OnSetFakeAcceleratedSurfaceWindowHandle( |
462 gfx::PluginWindowHandle window) { | 468 gfx::PluginWindowHandle window) { |
463 delegate_->set_windowed_handle(window); | 469 delegate_->set_windowed_handle(window); |
464 } | 470 } |
465 #endif | 471 #endif |
466 | 472 |
OLD | NEW |