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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 14859017: [content shell] implement auto resize related WebTestDelegate interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 7 months 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 | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.cc » ('j') | 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) 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 5277 matching lines...) Expand 10 before | Expand all | Expand 10 after
5288 webview()->enableAutoResizeMode(min_size, max_size); 5288 webview()->enableAutoResizeMode(min_size, max_size);
5289 } 5289 }
5290 5290
5291 void RenderViewImpl::OnDisableAutoResize(const gfx::Size& new_size) { 5291 void RenderViewImpl::OnDisableAutoResize(const gfx::Size& new_size) {
5292 DCHECK(disable_scrollbars_size_limit_.IsEmpty()); 5292 DCHECK(disable_scrollbars_size_limit_.IsEmpty());
5293 if (!webview()) 5293 if (!webview())
5294 return; 5294 return;
5295 auto_resize_mode_ = false; 5295 auto_resize_mode_ = false;
5296 webview()->disableAutoResizeMode(); 5296 webview()->disableAutoResizeMode();
5297 5297
5298 Resize(new_size, physical_backing_size_, overdraw_bottom_height_, 5298 if (!new_size.IsEmpty()) {
5299 resizer_rect_, is_fullscreen_, NO_RESIZE_ACK); 5299 Resize(new_size,
5300 physical_backing_size_,
5301 overdraw_bottom_height_,
5302 resizer_rect_,
5303 is_fullscreen_,
5304 NO_RESIZE_ACK);
5305 }
5300 } 5306 }
5301 5307
5302 void RenderViewImpl::OnEnablePreferredSizeChangedMode() { 5308 void RenderViewImpl::OnEnablePreferredSizeChangedMode() {
5303 if (send_preferred_size_changes_) 5309 if (send_preferred_size_changes_)
5304 return; 5310 return;
5305 send_preferred_size_changes_ = true; 5311 send_preferred_size_changes_ = true;
5306 5312
5307 // Start off with an initial preferred size notification (in case 5313 // Start off with an initial preferred size notification (in case
5308 // |didUpdateLayout| was already called). 5314 // |didUpdateLayout| was already called).
5309 didUpdateLayout(); 5315 didUpdateLayout();
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
6504 OnSetActive(false); 6510 OnSetActive(false);
6505 } 6511 }
6506 } 6512 }
6507 6513
6508 void RenderViewImpl::SetDeviceScaleFactorForTesting(float factor) { 6514 void RenderViewImpl::SetDeviceScaleFactorForTesting(float factor) {
6509 SetDeviceScaleFactor(factor); 6515 SetDeviceScaleFactor(factor);
6510 if (!auto_resize_mode_) 6516 if (!auto_resize_mode_)
6511 AutoResizeCompositor(); 6517 AutoResizeCompositor();
6512 } 6518 }
6513 6519
6520 void RenderViewImpl::EnableAutoResizeForTesting(const gfx::Size& min_size,
6521 const gfx::Size& max_size) {
6522 OnEnableAutoResize(min_size, max_size);
6523 }
6524
6525 void RenderViewImpl::DisableAutoResizeForTesting(const gfx::Size& new_size) {
6526 OnDisableAutoResize(new_size);
6527 }
6528
6514 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6529 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6515 TransportDIB::Handle dib_handle) { 6530 TransportDIB::Handle dib_handle) {
6516 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6531 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6517 RenderProcess::current()->ReleaseTransportDIB(dib); 6532 RenderProcess::current()->ReleaseTransportDIB(dib);
6518 } 6533 }
6519 6534
6520 void RenderViewImpl::DidCommitCompositorFrame() { 6535 void RenderViewImpl::DidCommitCompositorFrame() {
6521 RenderWidget::DidCommitCompositorFrame(); 6536 RenderWidget::DidCommitCompositorFrame();
6522 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); 6537 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame());
6523 } 6538 }
(...skipping 16 matching lines...) Expand all
6540 WebURL url = icon_urls[i].iconURL(); 6555 WebURL url = icon_urls[i].iconURL();
6541 if (!url.isEmpty()) 6556 if (!url.isEmpty())
6542 urls.push_back(FaviconURL(url, 6557 urls.push_back(FaviconURL(url,
6543 ToFaviconType(icon_urls[i].iconType()))); 6558 ToFaviconType(icon_urls[i].iconType())));
6544 } 6559 }
6545 SendUpdateFaviconURL(urls); 6560 SendUpdateFaviconURL(urls);
6546 } 6561 }
6547 6562
6548 6563
6549 } // namespace content 6564 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698