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

Unified Diff: third_party/WebKit/Source/core/html/ImageDocument.h

Issue 2319863006: Change image document zooming logic. (Closed)
Patch Set: minor edits Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/ImageDocument.h
diff --git a/third_party/WebKit/Source/core/html/ImageDocument.h b/third_party/WebKit/Source/core/html/ImageDocument.h
index 7602b27aa0aa303a57768f0ffcff90bb2315d6c0..47a15eb1466efbfb947a1402466c3b334c2b382d 100644
--- a/third_party/WebKit/Source/core/html/ImageDocument.h
+++ b/third_party/WebKit/Source/core/html/ImageDocument.h
@@ -40,15 +40,10 @@ public:
return new ImageDocument(initializer);
}
- enum ScaleType {
- ScaleZoomedDocument,
- ScaleOnlyUnzoomedDocument
- };
-
ImageResource* cachedImage();
HTMLImageElement* imageElement() const { return m_imageElement.get(); }
- void windowSizeChanged(ScaleType);
+ void windowSizeChanged();
void imageUpdated();
void imageClicked(int x, int y);
@@ -62,10 +57,12 @@ private:
void createDocumentStructure();
// These methods are for m_shrinkToFitMode == Desktop.
- void resizeImageToFit(ScaleType);
- void restoreImageSize(ScaleType);
+ void resizeImageToFit();
+ void restoreImageSize();
bool imageFitsInWindow() const;
bool shouldShrinkToFit() const;
+ // Calculates the image size multiplier that's needed to fit the image to
+ // the window, taking into account page zoom and device scale.
float scale() const;
Member<HTMLImageElement> m_imageElement;
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698