OLD | NEW |
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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 PPP_INPUT_EVENT_INTERFACE)); | 693 PPP_INPUT_EVENT_INTERFACE)); |
694 } | 694 } |
695 return !!plugin_input_event_interface_; | 695 return !!plugin_input_event_interface_; |
696 } | 696 } |
697 | 697 |
698 bool PluginInstance::LoadMessagingInterface() { | 698 bool PluginInstance::LoadMessagingInterface() { |
699 if (!checked_for_plugin_messaging_interface_) { | 699 if (!checked_for_plugin_messaging_interface_) { |
700 checked_for_plugin_messaging_interface_ = true; | 700 checked_for_plugin_messaging_interface_ = true; |
701 plugin_messaging_interface_ = | 701 plugin_messaging_interface_ = |
702 static_cast<const PPP_Messaging*>(module_->GetPluginInterface( | 702 static_cast<const PPP_Messaging*>(module_->GetPluginInterface( |
703 PPP_MESSAGING_INTERFACE)); | 703 PPP_MESSAGING_INTERFACE_1_0)); |
| 704 // TODO(dmichael): Remove support for 0.1. |
| 705 if (!plugin_messaging_interface_) { |
| 706 plugin_messaging_interface_ = |
| 707 static_cast<const PPP_Messaging*>(module_->GetPluginInterface( |
| 708 PPP_MESSAGING_INTERFACE_0_1)); |
| 709 } |
704 } | 710 } |
705 | 711 |
706 return !!plugin_messaging_interface_; | 712 return !!plugin_messaging_interface_; |
707 } | 713 } |
708 | 714 |
709 bool PluginInstance::LoadPdfInterface() { | 715 bool PluginInstance::LoadPdfInterface() { |
710 if (!plugin_pdf_interface_) { | 716 if (!plugin_pdf_interface_) { |
711 plugin_pdf_interface_ = | 717 plugin_pdf_interface_ = |
712 static_cast<const PPP_Pdf*>(module_->GetPluginInterface( | 718 static_cast<const PPP_Pdf*>(module_->GetPluginInterface( |
713 PPP_PDF_INTERFACE)); | 719 PPP_PDF_INTERFACE)); |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 } | 1552 } |
1547 delegate()->ZoomLimitsChanged(minimum_factor, maximium_factor); | 1553 delegate()->ZoomLimitsChanged(minimum_factor, maximium_factor); |
1548 } | 1554 } |
1549 | 1555 |
1550 void PluginInstance::PostMessage(PP_Instance instance, PP_Var message) { | 1556 void PluginInstance::PostMessage(PP_Instance instance, PP_Var message) { |
1551 message_channel_->PostMessageToJavaScript(message); | 1557 message_channel_->PostMessageToJavaScript(message); |
1552 } | 1558 } |
1553 | 1559 |
1554 } // namespace ppapi | 1560 } // namespace ppapi |
1555 } // namespace webkit | 1561 } // namespace webkit |
OLD | NEW |