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 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 underline.thick = true; | 1689 underline.thick = true; |
1690 underlines.push_back(underline); | 1690 underlines.push_back(underline); |
1691 } | 1691 } |
1692 | 1692 |
1693 delegate()->SimulateImeSetComposition( | 1693 delegate()->SimulateImeSetComposition( |
1694 utf16_text, underlines, offsets[0], offsets[1]); | 1694 utf16_text, underlines, offsets[0], offsets[1]); |
1695 } | 1695 } |
1696 | 1696 |
1697 void PluginInstance::ClosePendingUserGesture(PP_Instance instance, | 1697 void PluginInstance::ClosePendingUserGesture(PP_Instance instance, |
1698 PP_TimeTicks timestamp) { | 1698 PP_TimeTicks timestamp) { |
1699 // Close the pending user gesture if the plugin had a chance to respond. | 1699 // Do nothing so that the pending user gesture will stay open for |
1700 // Don't close the pending user gesture if the timestamps are equal since | 1700 // kUserGestureDurationInSeconds. |
1701 // there may be multiple input events with the same timestamp. | 1701 // TODO(yzshen): remove the code for closing pending user gesture. |
1702 if (timestamp > pending_user_gesture_) | |
1703 pending_user_gesture_ = 0.0; | |
1704 } | 1702 } |
1705 | 1703 |
1706 PP_Bool PluginInstance::BindGraphics(PP_Instance instance, | 1704 PP_Bool PluginInstance::BindGraphics(PP_Instance instance, |
1707 PP_Resource device) { | 1705 PP_Resource device) { |
1708 // The Graphics3D instance can't be destroyed until we call | 1706 // The Graphics3D instance can't be destroyed until we call |
1709 // setBackingTextureId. | 1707 // setBackingTextureId. |
1710 scoped_refptr< ::ppapi::Resource> old_graphics = bound_graphics_; | 1708 scoped_refptr< ::ppapi::Resource> old_graphics = bound_graphics_; |
1711 if (bound_graphics_.get()) { | 1709 if (bound_graphics_.get()) { |
1712 if (GetBoundGraphics2D()) { | 1710 if (GetBoundGraphics2D()) { |
1713 GetBoundGraphics2D()->BindToInstance(NULL); | 1711 GetBoundGraphics2D()->BindToInstance(NULL); |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2214 screen_size_for_fullscreen_ = gfx::Size(); | 2212 screen_size_for_fullscreen_ = gfx::Size(); |
2215 WebElement element = container_->element(); | 2213 WebElement element = container_->element(); |
2216 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2214 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2217 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2215 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2218 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2216 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2219 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2217 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2220 } | 2218 } |
2221 | 2219 |
2222 } // namespace ppapi | 2220 } // namespace ppapi |
2223 } // namespace webkit | 2221 } // namespace webkit |
OLD | NEW |