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/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 message_channel_(NULL), | 380 message_channel_(NULL), |
381 sad_plugin_(NULL), | 381 sad_plugin_(NULL), |
382 input_event_mask_(0), | 382 input_event_mask_(0), |
383 filtered_input_event_mask_(0), | 383 filtered_input_event_mask_(0), |
384 text_input_type_(kPluginDefaultTextInputType), | 384 text_input_type_(kPluginDefaultTextInputType), |
385 text_input_caret_(0, 0, 0, 0), | 385 text_input_caret_(0, 0, 0, 0), |
386 text_input_caret_bounds_(0, 0, 0, 0), | 386 text_input_caret_bounds_(0, 0, 0, 0), |
387 text_input_caret_set_(false), | 387 text_input_caret_set_(false), |
388 selection_caret_(0), | 388 selection_caret_(0), |
389 selection_anchor_(0), | 389 selection_anchor_(0), |
390 pending_user_gesture_(0.0), | 390 pending_user_gesture_(0.0) { |
391 flash_impl_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | |
392 pp_instance_ = HostGlobals::Get()->AddInstance(this); | 391 pp_instance_ = HostGlobals::Get()->AddInstance(this); |
393 | 392 |
394 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); | 393 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); |
395 DCHECK(delegate); | 394 DCHECK(delegate); |
396 module_->InstanceCreated(this); | 395 module_->InstanceCreated(this); |
397 delegate_->InstanceCreated(this); | 396 delegate_->InstanceCreated(this); |
398 message_channel_.reset(new MessageChannel(this)); | 397 message_channel_.reset(new MessageChannel(this)); |
399 | 398 |
400 view_data_.is_page_visible = delegate->IsPageVisible(); | 399 view_data_.is_page_visible = delegate->IsPageVisible(); |
401 | 400 |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2133 PP_Bool fullscreen) { | 2132 PP_Bool fullscreen) { |
2134 return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen))); | 2133 return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen))); |
2135 } | 2134 } |
2136 | 2135 |
2137 PP_Bool PluginInstance::GetScreenSize(PP_Instance instance, PP_Size* size) { | 2136 PP_Bool PluginInstance::GetScreenSize(PP_Instance instance, PP_Size* size) { |
2138 gfx::Size screen_size = delegate()->GetScreenSize(); | 2137 gfx::Size screen_size = delegate()->GetScreenSize(); |
2139 *size = PP_MakeSize(screen_size.width(), screen_size.height()); | 2138 *size = PP_MakeSize(screen_size.width(), screen_size.height()); |
2140 return PP_TRUE; | 2139 return PP_TRUE; |
2141 } | 2140 } |
2142 | 2141 |
2143 ::ppapi::thunk::PPB_Flash_API* PluginInstance::GetFlashAPI() { | |
2144 return &flash_impl_; | |
2145 } | |
2146 | |
2147 ::ppapi::Resource* PluginInstance::GetSingletonResource( | 2142 ::ppapi::Resource* PluginInstance::GetSingletonResource( |
2148 PP_Instance instance, | 2143 PP_Instance instance, |
2149 ::ppapi::SingletonResourceID id) { | 2144 ::ppapi::SingletonResourceID id) { |
2150 // Flash APIs and some others aren't implemented in-process. | 2145 // Flash APIs and some others aren't implemented in-process. |
2151 switch (id) { | 2146 switch (id) { |
2152 case ::ppapi::BROKER_SINGLETON_ID: | 2147 case ::ppapi::BROKER_SINGLETON_ID: |
2153 case ::ppapi::BROWSER_FONT_SINGLETON_ID: | 2148 case ::ppapi::BROWSER_FONT_SINGLETON_ID: |
2154 case ::ppapi::FLASH_CLIPBOARD_SINGLETON_ID: | 2149 case ::ppapi::FLASH_CLIPBOARD_SINGLETON_ID: |
2155 case ::ppapi::FLASH_FILE_SINGLETON_ID: | 2150 case ::ppapi::FLASH_FILE_SINGLETON_ID: |
2156 case ::ppapi::FLASH_FULLSCREEN_SINGLETON_ID: | 2151 case ::ppapi::FLASH_FULLSCREEN_SINGLETON_ID: |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2512 screen_size_for_fullscreen_ = gfx::Size(); | 2507 screen_size_for_fullscreen_ = gfx::Size(); |
2513 WebElement element = container_->element(); | 2508 WebElement element = container_->element(); |
2514 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2509 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2515 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2510 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2516 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2511 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2517 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2512 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2518 } | 2513 } |
2519 | 2514 |
2520 } // namespace ppapi | 2515 } // namespace ppapi |
2521 } // namespace webkit | 2516 } // namespace webkit |
OLD | NEW |