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 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 underline.thick = true; | 1675 underline.thick = true; |
1676 underlines.push_back(underline); | 1676 underlines.push_back(underline); |
1677 } | 1677 } |
1678 | 1678 |
1679 delegate()->SimulateImeSetComposition( | 1679 delegate()->SimulateImeSetComposition( |
1680 utf16_text, underlines, offsets[0], offsets[1]); | 1680 utf16_text, underlines, offsets[0], offsets[1]); |
1681 } | 1681 } |
1682 | 1682 |
1683 void PluginInstance::ClosePendingUserGesture(PP_Instance instance, | 1683 void PluginInstance::ClosePendingUserGesture(PP_Instance instance, |
1684 PP_TimeTicks timestamp) { | 1684 PP_TimeTicks timestamp) { |
1685 // Close the pending user gesture if the plugin had a chance to respond. | 1685 // Do nothing so that the pending user gesture will stay open for |
1686 // Don't close the pending user gesture if the timestamps are equal since | 1686 // kUserGestureDurationInSeconds. |
1687 // there may be multiple input events with the same timestamp. | 1687 // TODO(yzshen): remove the code for closing pending user gesture. |
1688 if (timestamp > pending_user_gesture_) | |
1689 pending_user_gesture_ = 0.0; | |
1690 } | 1688 } |
1691 | 1689 |
1692 PP_Bool PluginInstance::BindGraphics(PP_Instance instance, | 1690 PP_Bool PluginInstance::BindGraphics(PP_Instance instance, |
1693 PP_Resource device) { | 1691 PP_Resource device) { |
1694 // The Graphics3D instance can't be destroyed until we call | 1692 // The Graphics3D instance can't be destroyed until we call |
1695 // setBackingTextureId. | 1693 // setBackingTextureId. |
1696 scoped_refptr< ::ppapi::Resource> old_graphics = bound_graphics_; | 1694 scoped_refptr< ::ppapi::Resource> old_graphics = bound_graphics_; |
1697 if (bound_graphics_.get()) { | 1695 if (bound_graphics_.get()) { |
1698 if (GetBoundGraphics2D()) { | 1696 if (GetBoundGraphics2D()) { |
1699 GetBoundGraphics2D()->BindToInstance(NULL); | 1697 GetBoundGraphics2D()->BindToInstance(NULL); |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2152 screen_size_for_fullscreen_ = gfx::Size(); | 2150 screen_size_for_fullscreen_ = gfx::Size(); |
2153 WebElement element = container_->element(); | 2151 WebElement element = container_->element(); |
2154 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2152 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2155 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2153 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2156 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2154 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2157 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2155 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2158 } | 2156 } |
2159 | 2157 |
2160 } // namespace ppapi | 2158 } // namespace ppapi |
2161 } // namespace webkit | 2159 } // namespace webkit |
OLD | NEW |