OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_webplugin_impl.h" | 5 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 NPObject* WebPluginImpl::scriptableObject() { | 90 NPObject* WebPluginImpl::scriptableObject() { |
91 scoped_refptr<ObjectVar> object( | 91 scoped_refptr<ObjectVar> object( |
92 ObjectVar::FromPPVar(instance_->GetInstanceObject())); | 92 ObjectVar::FromPPVar(instance_->GetInstanceObject())); |
93 if (object) | 93 if (object) |
94 return object->np_object(); | 94 return object->np_object(); |
95 return NULL; | 95 return NULL; |
96 } | 96 } |
97 | 97 |
98 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { | 98 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { |
99 if (!instance_->IsFullscreen()) | 99 if (!instance_->IsFullscreenOrPending()) |
100 instance_->Paint(canvas, plugin_rect_, rect); | 100 instance_->Paint(canvas, plugin_rect_, rect); |
101 } | 101 } |
102 | 102 |
103 void WebPluginImpl::updateGeometry( | 103 void WebPluginImpl::updateGeometry( |
104 const WebRect& window_rect, | 104 const WebRect& window_rect, |
105 const WebRect& clip_rect, | 105 const WebRect& clip_rect, |
106 const WebVector<WebRect>& cut_outs_rects, | 106 const WebVector<WebRect>& cut_outs_rects, |
107 bool is_visible) { | 107 bool is_visible) { |
108 plugin_rect_ = window_rect; | 108 plugin_rect_ = window_rect; |
109 if (!instance_->IsFullscreen()) | 109 if (!instance_->IsFullscreenOrPending()) |
110 instance_->ViewChanged(plugin_rect_, clip_rect); | 110 instance_->ViewChanged(plugin_rect_, clip_rect); |
111 } | 111 } |
112 | 112 |
113 unsigned WebPluginImpl::getBackingTextureId() { | 113 unsigned WebPluginImpl::getBackingTextureId() { |
114 return instance_->GetBackingTextureId(); | 114 return instance_->GetBackingTextureId(); |
115 } | 115 } |
116 | 116 |
117 void WebPluginImpl::updateFocus(bool focused) { | 117 void WebPluginImpl::updateFocus(bool focused) { |
118 instance_->SetWebKitFocus(focused); | 118 instance_->SetWebKitFocus(focused); |
119 } | 119 } |
120 | 120 |
121 void WebPluginImpl::updateVisibility(bool visible) { | 121 void WebPluginImpl::updateVisibility(bool visible) { |
122 } | 122 } |
123 | 123 |
124 bool WebPluginImpl::acceptsInputEvents() { | 124 bool WebPluginImpl::acceptsInputEvents() { |
125 return true; | 125 return true; |
126 } | 126 } |
127 | 127 |
128 bool WebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event, | 128 bool WebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event, |
129 WebKit::WebCursorInfo& cursor_info) { | 129 WebKit::WebCursorInfo& cursor_info) { |
130 if (instance_->IsFullscreen()) | 130 if (instance_->IsFullscreenOrPending()) |
131 return false; | 131 return false; |
132 return instance_->HandleInputEvent(event, &cursor_info); | 132 return instance_->HandleInputEvent(event, &cursor_info); |
133 } | 133 } |
134 | 134 |
135 void WebPluginImpl::didReceiveResponse( | 135 void WebPluginImpl::didReceiveResponse( |
136 const WebKit::WebURLResponse& response) { | 136 const WebKit::WebURLResponse& response) { |
137 DCHECK(!document_loader_); | 137 DCHECK(!document_loader_); |
138 | 138 |
139 document_loader_ = new PPB_URLLoader_Impl(instance_, true); | 139 document_loader_ = new PPB_URLLoader_Impl(instance_, true); |
140 document_loader_->didReceiveResponse(NULL, response); | 140 document_loader_->didReceiveResponse(NULL, response); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 return instance_->PrintPage(page_number, canvas); | 220 return instance_->PrintPage(page_number, canvas); |
221 } | 221 } |
222 | 222 |
223 void WebPluginImpl::printEnd() { | 223 void WebPluginImpl::printEnd() { |
224 return instance_->PrintEnd(); | 224 return instance_->PrintEnd(); |
225 } | 225 } |
226 | 226 |
227 } // namespace ppapi | 227 } // namespace ppapi |
228 } // namespace webkit | 228 } // namespace webkit |
229 | 229 |
OLD | NEW |