| Differences between
and this patch
- a/Source/WebKit/chromium/ChangeLog +22 lines
Lines 1-3 a/Source/WebKit/chromium/ChangeLog_sec1
1
2011-11-04  Fady Samuel  <fsamuel@chromium.org>
2
3
        [Chromium] Expose deviceScaleFactor to WebKit API
4
        https://bugs.webkit.org/show_bug.cgi?id=70614
5
6
        Reviewed by Darin Fisher.
7
8
        This exposes the device scale factor to the Chromium-WebKit API.
9
        This scale factor is the ratio between the current device's DPI
10
        and the target device's DPI. 
11
12
        For details on how this can be accessed from CSS and javascript, please
13
        see here:
14
15
        http://developer.android.com/guide/webapps/targeting.html#DensityCSS
16
17
        * public/WebView.h:
18
        * src/WebViewImpl.cpp:
19
        (WebKit::WebViewImpl::deviceScaleFactor):
20
        (WebKit::WebViewImpl::setDeviceScaleFactor):
21
        * src/WebViewImpl.h:
22
1
2011-11-02  Xiaomei Ji  <xji@chromium.org>
23
2011-11-02  Xiaomei Ji  <xji@chromium.org>
2
24
3
        Enable ctrl-arrow move cursor by word in visual order in cr-win by command line flag.
25
        Enable ctrl-arrow move cursor by word in visual order in cr-win by command line flag.
- a/Source/WebKit/chromium/public/WebView.h +6 lines
Lines 216-221 public: a/Source/WebKit/chromium/public/WebView.h_sec1
216
    // On the other hand, zooming affects layout of the page.
216
    // On the other hand, zooming affects layout of the page.
217
    virtual void scalePage(float scaleFactor, WebPoint origin) = 0;
217
    virtual void scalePage(float scaleFactor, WebPoint origin) = 0;
218
218
219
    // The ratio of the current device's screen DPI to the target device's screen DPI.
220
    virtual float deviceScaleFactor() const = 0;
221
222
    // Sets the ratio as computed by computeViewportAttributes.
223
    virtual void setDeviceScaleFactor(float) = 0;
224
219
225
220
    // Fixed Layout --------------------------------------------------------
226
    // Fixed Layout --------------------------------------------------------
221
227
- a/Source/WebKit/chromium/src/WebViewImpl.cpp +16 lines
Lines 1853-1858 void WebViewImpl::scalePage(float scaleFactor, WebPoint origin) a/Source/WebKit/chromium/src/WebViewImpl.cpp_sec1
1853
    page()->setPageScaleFactor(scaleFactor, origin);
1853
    page()->setPageScaleFactor(scaleFactor, origin);
1854
}
1854
}
1855
1855
1856
float WebViewImpl::deviceScaleFactor() const
1857
{
1858
    if (!page())
1859
        return 1;
1860
1861
    return page()->deviceScaleFactor();
1862
}
1863
1864
void WebViewImpl::setDeviceScaleFactor(float scaleFactor)
1865
{
1866
    if (!page())
1867
        return;
1868
1869
    page()->setDeviceScaleFactor(scaleFactor);
1870
}
1871
1856
bool WebViewImpl::isFixedLayoutModeEnabled() const
1872
bool WebViewImpl::isFixedLayoutModeEnabled() const
1857
{
1873
{
1858
    if (!page())
1874
    if (!page())
- a/Source/WebKit/chromium/src/WebViewImpl.h +2 lines
Lines 159-164 public: a/Source/WebKit/chromium/src/WebViewImpl.h_sec1
159
                                   double maximumZoomLevel);
159
                                   double maximumZoomLevel);
160
    virtual float pageScaleFactor() const;
160
    virtual float pageScaleFactor() const;
161
    virtual void scalePage(float scaleFactor, WebPoint origin);
161
    virtual void scalePage(float scaleFactor, WebPoint origin);
162
    virtual float deviceScaleFactor() const;
163
    virtual void setDeviceScaleFactor(float);
162
    virtual bool isFixedLayoutModeEnabled() const;
164
    virtual bool isFixedLayoutModeEnabled() const;
163
    virtual void enableFixedLayoutMode(bool enable);
165
    virtual void enableFixedLayoutMode(bool enable);
164
    virtual WebSize fixedLayoutSize() const;
166
    virtual WebSize fixedLayoutSize() const;

Return to Bug 70614