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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 sad_plugin_(NULL), | 309 sad_plugin_(NULL), |
310 input_event_mask_(0), | 310 input_event_mask_(0), |
311 filtered_input_event_mask_(0), | 311 filtered_input_event_mask_(0), |
312 text_input_type_(kPluginDefaultTextInputType), | 312 text_input_type_(kPluginDefaultTextInputType), |
313 text_input_caret_(0, 0, 0, 0), | 313 text_input_caret_(0, 0, 0, 0), |
314 text_input_caret_bounds_(0, 0, 0, 0), | 314 text_input_caret_bounds_(0, 0, 0, 0), |
315 text_input_caret_set_(false), | 315 text_input_caret_set_(false), |
316 selection_caret_(0), | 316 selection_caret_(0), |
317 selection_anchor_(0), | 317 selection_anchor_(0), |
318 lock_mouse_callback_(PP_BlockUntilComplete()), | 318 lock_mouse_callback_(PP_BlockUntilComplete()), |
319 pending_user_gesture_(0.0) { | 319 pending_user_gesture_(0.0), |
| 320 flash_impl_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
320 pp_instance_ = HostGlobals::Get()->AddInstance(this); | 321 pp_instance_ = HostGlobals::Get()->AddInstance(this); |
321 | 322 |
322 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); | 323 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); |
323 DCHECK(delegate); | 324 DCHECK(delegate); |
324 module_->InstanceCreated(this); | 325 module_->InstanceCreated(this); |
325 delegate_->InstanceCreated(this); | 326 delegate_->InstanceCreated(this); |
326 message_channel_.reset(new MessageChannel(this)); | 327 message_channel_.reset(new MessageChannel(this)); |
327 | 328 |
328 view_data_.is_page_visible = delegate->IsPageVisible(); | 329 view_data_.is_page_visible = delegate->IsPageVisible(); |
329 } | 330 } |
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1775 delegate_->NumberOfFindResultsChanged(find_identifier_, total, | 1776 delegate_->NumberOfFindResultsChanged(find_identifier_, total, |
1776 PP_ToBool(final_result)); | 1777 PP_ToBool(final_result)); |
1777 } | 1778 } |
1778 | 1779 |
1779 void PluginInstance::SelectedFindResultChanged(PP_Instance instance, | 1780 void PluginInstance::SelectedFindResultChanged(PP_Instance instance, |
1780 int32_t index) { | 1781 int32_t index) { |
1781 DCHECK_NE(find_identifier_, -1); | 1782 DCHECK_NE(find_identifier_, -1); |
1782 delegate_->SelectedFindResultChanged(find_identifier_, index); | 1783 delegate_->SelectedFindResultChanged(find_identifier_, index); |
1783 } | 1784 } |
1784 | 1785 |
1785 PP_Bool PluginInstance::FlashIsFullscreen(PP_Instance instance) { | |
1786 return PP_FromBool(flash_fullscreen_); | |
1787 } | |
1788 | |
1789 PP_Bool PluginInstance::SetFullscreen(PP_Instance instance, | 1786 PP_Bool PluginInstance::SetFullscreen(PP_Instance instance, |
1790 PP_Bool fullscreen) { | 1787 PP_Bool fullscreen) { |
1791 return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen))); | 1788 return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen))); |
1792 } | 1789 } |
1793 | 1790 |
1794 PP_Bool PluginInstance::FlashSetFullscreen(PP_Instance instance, | |
1795 PP_Bool fullscreen) { | |
1796 FlashSetFullscreen(PP_ToBool(fullscreen), true); | |
1797 return PP_TRUE; | |
1798 } | |
1799 | |
1800 PP_Bool PluginInstance::GetScreenSize(PP_Instance instance, PP_Size* size) { | 1791 PP_Bool PluginInstance::GetScreenSize(PP_Instance instance, PP_Size* size) { |
1801 gfx::Size screen_size = delegate()->GetScreenSize(); | 1792 gfx::Size screen_size = delegate()->GetScreenSize(); |
1802 *size = PP_MakeSize(screen_size.width(), screen_size.height()); | 1793 *size = PP_MakeSize(screen_size.width(), screen_size.height()); |
1803 return PP_TRUE; | 1794 return PP_TRUE; |
1804 } | 1795 } |
1805 | 1796 |
1806 PP_Bool PluginInstance::FlashGetScreenSize(PP_Instance instance, | 1797 ::ppapi::thunk::PPB_Flash_API* PluginInstance::GetFlashAPI() { |
1807 PP_Size* size) { | 1798 return &flash_impl_; |
1808 return GetScreenSize(instance, size); | |
1809 } | 1799 } |
1810 | 1800 |
1811 int32_t PluginInstance::RequestInputEvents(PP_Instance instance, | 1801 int32_t PluginInstance::RequestInputEvents(PP_Instance instance, |
1812 uint32_t event_classes) { | 1802 uint32_t event_classes) { |
1813 input_event_mask_ |= event_classes; | 1803 input_event_mask_ |= event_classes; |
1814 filtered_input_event_mask_ &= ~(event_classes); | 1804 filtered_input_event_mask_ &= ~(event_classes); |
1815 return ValidateRequestInputEvents(false, event_classes); | 1805 return ValidateRequestInputEvents(false, event_classes); |
1816 } | 1806 } |
1817 | 1807 |
1818 int32_t PluginInstance::RequestFilteringInputEvents(PP_Instance instance, | 1808 int32_t PluginInstance::RequestFilteringInputEvents(PP_Instance instance, |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2043 screen_size_for_fullscreen_ = gfx::Size(); | 2033 screen_size_for_fullscreen_ = gfx::Size(); |
2044 WebElement element = container_->element(); | 2034 WebElement element = container_->element(); |
2045 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2035 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2046 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2036 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2047 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2037 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2048 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2038 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2049 } | 2039 } |
2050 | 2040 |
2051 } // namespace ppapi | 2041 } // namespace ppapi |
2052 } // namespace webkit | 2042 } // namespace webkit |
OLD | NEW |