Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: webkit/glue/webplugin_impl.cc

Issue 8775: This fixes bug http://code.google.com/p/chromium/issues/detail?id=3881, which... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webplugin_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "config.h" 5 #include "config.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 MSVC_PUSH_WARNING_LEVEL(0); 10 MSVC_PUSH_WARNING_LEVEL(0);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // This is to force an updategeometry call to the plugin process 181 // This is to force an updategeometry call to the plugin process
182 // where the plugin window can be hidden or shown. 182 // where the plugin window can be hidden or shown.
183 frameRectsChanged(); 183 frameRectsChanged();
184 } 184 }
185 } 185 }
186 186
187 void WebPluginContainer::handleEvent(WebCore::Event* event) { 187 void WebPluginContainer::handleEvent(WebCore::Event* event) {
188 impl_->handleEvent(event); 188 impl_->handleEvent(event);
189 } 189 }
190 190
191 void WebPluginContainer::frameRectsChanged() const {
192 WebCore::Widget::frameRectsChanged();
193 // This is a hack to tickle re-positioning of the plugin in the case where
194 // our parent view was scrolled.
195 impl_->setFrameRect(frameRect());
196 }
197
198 // We override this function, to make sure that geometry updates are sent
199 // over to the plugin. For e.g. when a plugin is instantiated it does
200 // not have a valid parent. As a result the first geometry update from
201 // webkit is ignored. This function is called when the plugin eventually
202 // gets a parent.
203 void WebPluginContainer::setParentVisible(bool visible) {
204 WebCore::Widget::setParentVisible(visible);
205 if (visible)
206 show();
207 else
208 hide();
209 }
210
191 void WebPluginContainer::windowCutoutRects(const WebCore::IntRect& bounds, 211 void WebPluginContainer::windowCutoutRects(const WebCore::IntRect& bounds,
192 WTF::Vector<WebCore::IntRect>* 212 WTF::Vector<WebCore::IntRect>*
193 cutouts) const { 213 cutouts) const {
194 impl_->windowCutoutRects(bounds, cutouts); 214 impl_->windowCutoutRects(bounds, cutouts);
195 } 215 }
196 216
197 void WebPluginContainer::didReceiveResponse( 217 void WebPluginContainer::didReceiveResponse(
198 const WebCore::ResourceResponse& response) { 218 const WebCore::ResourceResponse& response) {
199 219
200 HttpResponseInfo http_response_info; 220 HttpResponseInfo http_response_info;
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 if (!ro->style() || ro->style()->visibility() == WebCore::VISIBLE) { 603 if (!ro->style() || ro->style()->visibility() == WebCore::VISIBLE) {
584 int x, y; 604 int x, y;
585 ro->absolutePosition(x, y); 605 ro->absolutePosition(x, y);
586 cutouts->append(WebCore::IntRect(x, y, ro->width(), ro->height())); 606 cutouts->append(WebCore::IntRect(x, y, ro->width(), ro->height()));
587 } 607 }
588 } 608 }
589 } 609 }
590 } 610 }
591 } 611 }
592 612
593 void WebPluginImpl::geometryChanged() const {
594 if (!widget_)
595 return;
596
597 // This is a hack to tickle re-positioning of the plugin in the case where
598 // our parent view was scrolled.
599 const_cast<WebPluginImpl*>(this)->widget_->setFrameRect(
600 widget_->frameRect());
601 }
602
603 void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) { 613 void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) {
604 // Compute a new position and clip rect for ourselves relative to the 614 // Compute a new position and clip rect for ourselves relative to the
605 // containing window. We ask our delegate to reposition us accordingly. 615 // containing window. We ask our delegate to reposition us accordingly.
606 616
607 // When the plugin is loaded we don't have a parent frame yet. We need 617 // When the plugin is loaded we don't have a parent frame yet. We need
608 // to force the plugin window to get created in the plugin process, 618 // to force the plugin window to get created in the plugin process,
609 // when the plugin widget position is updated. This occurs just after 619 // when the plugin widget position is updated. This occurs just after
610 // the plugin is loaded (See http://b/issue?id=892174). 620 // the plugin is loaded (See http://b/issue?id=892174).
611 if (!parent()) { 621 if (!parent()) {
612 force_geometry_update_ = true; 622 force_geometry_update_ = true;
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 1291
1282 MultiPartResponseClient* multi_part_response_client = 1292 MultiPartResponseClient* multi_part_response_client =
1283 new MultiPartResponseClient(client); 1293 new MultiPartResponseClient(client);
1284 1294
1285 MultipartResponseDelegate* multi_part_response_handler = 1295 MultipartResponseDelegate* multi_part_response_handler =
1286 new MultipartResponseDelegate(multi_part_response_client, NULL, 1296 new MultipartResponseDelegate(multi_part_response_client, NULL,
1287 response, 1297 response,
1288 multipart_boundary); 1298 multipart_boundary);
1289 multi_part_response_map_[client] = multi_part_response_handler; 1299 multi_part_response_map_[client] = multi_part_response_handler;
1290 } 1300 }
OLDNEW
« no previous file with comments | « webkit/glue/webplugin_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698