| 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 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 bool PluginInstance::IsProcessingUserGesture() { | 1599 bool PluginInstance::IsProcessingUserGesture() { |
| 1600 PP_TimeTicks now = | 1600 PP_TimeTicks now = |
| 1601 ::ppapi::TimeTicksToPPTimeTicks(base::TimeTicks::Now()); | 1601 ::ppapi::TimeTicksToPPTimeTicks(base::TimeTicks::Now()); |
| 1602 // Give a lot of slack so tests won't be flaky. Well behaved plugins will | 1602 // Give a lot of slack so tests won't be flaky. Well behaved plugins will |
| 1603 // close the user gesture. | 1603 // close the user gesture. |
| 1604 const PP_TimeTicks kUserGestureDurationInSeconds = 10.0; | 1604 const PP_TimeTicks kUserGestureDurationInSeconds = 10.0; |
| 1605 return (now - pending_user_gesture_ < kUserGestureDurationInSeconds); | 1605 return (now - pending_user_gesture_ < kUserGestureDurationInSeconds); |
| 1606 } | 1606 } |
| 1607 | 1607 |
| 1608 void PluginInstance::OnLockMouseACK(bool succeeded) { | 1608 void PluginInstance::OnLockMouseACK(bool succeeded) { |
| 1609 if (TrackedCallback::IsPending(lock_mouse_callback_)) { | 1609 if (!TrackedCallback::IsPending(lock_mouse_callback_)) { |
| 1610 NOTREACHED(); | 1610 NOTREACHED(); |
| 1611 return; | 1611 return; |
| 1612 } | 1612 } |
| 1613 TrackedCallback::ClearAndRun(&lock_mouse_callback_, | 1613 TrackedCallback::ClearAndRun(&lock_mouse_callback_, |
| 1614 succeeded ? PP_OK : PP_ERROR_FAILED); | 1614 succeeded ? PP_OK : PP_ERROR_FAILED); |
| 1615 } | 1615 } |
| 1616 | 1616 |
| 1617 void PluginInstance::OnMouseLockLost() { | 1617 void PluginInstance::OnMouseLockLost() { |
| 1618 if (LoadMouseLockInterface()) | 1618 if (LoadMouseLockInterface()) |
| 1619 plugin_mouse_lock_interface_->MouseLockLost(pp_instance()); | 1619 plugin_mouse_lock_interface_->MouseLockLost(pp_instance()); |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2214 screen_size_for_fullscreen_ = gfx::Size(); | 2214 screen_size_for_fullscreen_ = gfx::Size(); |
| 2215 WebElement element = container_->element(); | 2215 WebElement element = container_->element(); |
| 2216 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2216 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
| 2217 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2217 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
| 2218 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2218 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
| 2219 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2219 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
| 2220 } | 2220 } |
| 2221 | 2221 |
| 2222 } // namespace ppapi | 2222 } // namespace ppapi |
| 2223 } // namespace webkit | 2223 } // namespace webkit |
| OLD | NEW |