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

Side by Side Diff: Source/core/html/ImageDocument.cpp

Issue 1158673006: Replace various ScrollableArea scroll methods with setScrollPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Build fix Created 5 years, 6 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
« no previous file with comments | « Source/core/frame/RootFrameViewportTest.cpp ('k') | Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 else { 288 else {
289 restoreImageSize(ScaleZoomedDocument); 289 restoreImageSize(ScaleZoomedDocument);
290 290
291 updateLayout(); 291 updateLayout();
292 292
293 double scale = this->scale(); 293 double scale = this->scale();
294 294
295 double scrollX = x / scale - static_cast<double>(frame()->view()->width( )) / 2; 295 double scrollX = x / scale - static_cast<double>(frame()->view()->width( )) / 2;
296 double scrollY = y / scale - static_cast<double>(frame()->view()->height ()) / 2; 296 double scrollY = y / scale - static_cast<double>(frame()->view()->height ()) / 2;
297 297
298 frame()->view()->setScrollPosition(DoublePoint(scrollX, scrollY)); 298 frame()->view()->setScrollPosition(DoublePoint(scrollX, scrollY), Progra mmaticScroll);
299 } 299 }
300 } 300 }
301 301
302 void ImageDocument::imageUpdated() 302 void ImageDocument::imageUpdated()
303 { 303 {
304 ASSERT(m_imageElement); 304 ASSERT(m_imageElement);
305 305
306 if (m_imageSizeIsKnown) 306 if (m_imageSizeIsKnown)
307 return; 307 return;
308 308
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 } 443 }
444 444
445 bool ImageEventListener::operator==(const EventListener& listener) 445 bool ImageEventListener::operator==(const EventListener& listener)
446 { 446 {
447 if (const ImageEventListener* imageEventListener = ImageEventListener::cast( &listener)) 447 if (const ImageEventListener* imageEventListener = ImageEventListener::cast( &listener))
448 return m_doc == imageEventListener->m_doc; 448 return m_doc == imageEventListener->m_doc;
449 return false; 449 return false;
450 } 450 }
451 451
452 } 452 }
OLDNEW
« no previous file with comments | « Source/core/frame/RootFrameViewportTest.cpp ('k') | Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698