| 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/renderer/npapi/webplugin_impl.h" | 5 #include "content/renderer/npapi/webplugin_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 | 571 |
| 572 // Lie to ourselves about being windowless even if we got a fake | 572 // Lie to ourselves about being windowless even if we got a fake |
| 573 // plugin window handle, so we continue to get input events. | 573 // plugin window handle, so we continue to get input events. |
| 574 windowless_ = true; | 574 windowless_ = true; |
| 575 accepts_input_events_ = true; | 575 accepts_input_events_ = true; |
| 576 // We do not really need to notify the page delegate that a plugin | 576 // We do not really need to notify the page delegate that a plugin |
| 577 // window was created -- so don't. | 577 // window was created -- so don't. |
| 578 #else | 578 #else |
| 579 accepts_input_events_ = false; | 579 accepts_input_events_ = false; |
| 580 | 580 |
| 581 #if defined(USE_X11) | |
| 582 // Tell the view delegate that the plugin window was created, so that it | |
| 583 // can create necessary container widgets. | |
| 584 render_frame_->Send(new ViewHostMsg_CreatePluginContainer( | |
| 585 render_frame_->GetRenderWidget()->routing_id(), window)); | |
| 586 #endif // USE_X11 | |
| 587 | |
| 588 #endif // OS_MACOSX | 581 #endif // OS_MACOSX |
| 589 } else { | 582 } else { |
| 590 DCHECK(!window_); // Make sure not called twice. | 583 DCHECK(!window_); // Make sure not called twice. |
| 591 windowless_ = true; | 584 windowless_ = true; |
| 592 accepts_input_events_ = true; | 585 accepts_input_events_ = true; |
| 593 } | 586 } |
| 594 } | 587 } |
| 595 | 588 |
| 596 void WebPluginImpl::SetAcceptsInputEvents(bool accepts) { | 589 void WebPluginImpl::SetAcceptsInputEvents(bool accepts) { |
| 597 accepts_input_events_ = accepts; | 590 accepts_input_events_ = accepts; |
| 598 } | 591 } |
| 599 | 592 |
| 600 void WebPluginImpl::WillDestroyWindow(gfx::PluginWindowHandle window) { | 593 void WebPluginImpl::WillDestroyWindow(gfx::PluginWindowHandle window) { |
| 601 DCHECK_EQ(window, window_); | 594 DCHECK_EQ(window, window_); |
| 602 window_ = gfx::kNullPluginWindow; | 595 window_ = gfx::kNullPluginWindow; |
| 603 if (render_view_.get()) { | 596 if (render_view_.get()) |
| 604 #if defined(USE_X11) | |
| 605 render_frame_->Send(new ViewHostMsg_DestroyPluginContainer( | |
| 606 render_frame_->GetRenderWidget()->routing_id(), window)); | |
| 607 #endif | |
| 608 render_frame_->GetRenderWidget()->CleanupWindowInPluginMoves(window); | 597 render_frame_->GetRenderWidget()->CleanupWindowInPluginMoves(window); |
| 609 } | |
| 610 } | 598 } |
| 611 | 599 |
| 612 GURL WebPluginImpl::CompleteURL(const char* url) { | 600 GURL WebPluginImpl::CompleteURL(const char* url) { |
| 613 if (!webframe_) { | 601 if (!webframe_) { |
| 614 NOTREACHED(); | 602 NOTREACHED(); |
| 615 return GURL(); | 603 return GURL(); |
| 616 } | 604 } |
| 617 // TODO(darin): Is conversion from UTF8 correct here? | 605 // TODO(darin): Is conversion from UTF8 correct here? |
| 618 return webframe_->document().completeURL(WebString::fromUTF8(url)); | 606 return webframe_->document().completeURL(WebString::fromUTF8(url)); |
| 619 } | 607 } |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 case PLUGIN_SRC: | 1523 case PLUGIN_SRC: |
| 1536 webframe_->setReferrerForRequest(*request, plugin_url_); | 1524 webframe_->setReferrerForRequest(*request, plugin_url_); |
| 1537 break; | 1525 break; |
| 1538 | 1526 |
| 1539 default: | 1527 default: |
| 1540 break; | 1528 break; |
| 1541 } | 1529 } |
| 1542 } | 1530 } |
| 1543 | 1531 |
| 1544 } // namespace content | 1532 } // namespace content |
| OLD | NEW |