Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1871 if (!document || !document->page()) { | 1871 if (!document || !document->page()) { |
| 1872 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's page cannot be retrieved." : "No context document can be obtained."); | 1872 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's page cannot be retrieved." : "No context document can be obtained."); |
| 1873 return 0; | 1873 return 0; |
| 1874 } | 1874 } |
| 1875 Page* page = document->page(); | 1875 Page* page = document->page(); |
| 1876 return page->frameHost().visualViewport().pageScale(); | 1876 return page->frameHost().visualViewport().pageScale(); |
| 1877 } | 1877 } |
| 1878 | 1878 |
| 1879 void Internals::setPageScaleFactor(float scaleFactor, ExceptionState& exceptionS tate) | 1879 void Internals::setPageScaleFactor(float scaleFactor, ExceptionState& exceptionS tate) |
| 1880 { | 1880 { |
| 1881 // -1 is the initial value of page scale factor in blink, it should never be | |
| 1882 // set by external methods. | |
| 1883 if (scaleFactor == -1) | |
|
bokan
2016/09/20 17:32:09
it's not the initial value. It's a value used by t
sunxd
2016/09/20 17:47:10
Done.
| |
| 1884 return; | |
| 1881 Document* document = contextDocument(); | 1885 Document* document = contextDocument(); |
| 1882 if (!document || !document->page()) { | 1886 if (!document || !document->page()) { |
| 1883 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's page cannot be retrieved." : "No context document can be obtained."); | 1887 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's page cannot be retrieved." : "No context document can be obtained."); |
| 1884 return; | 1888 return; |
| 1885 } | 1889 } |
| 1886 Page* page = document->page(); | 1890 Page* page = document->page(); |
| 1887 page->frameHost().visualViewport().setScale(scaleFactor); | 1891 page->frameHost().visualViewport().setScale(scaleFactor); |
| 1888 } | 1892 } |
| 1889 | 1893 |
| 1890 void Internals::setPageScaleFactorLimits(float minScaleFactor, float maxScaleFac tor, ExceptionState& exceptionState) | 1894 void Internals::setPageScaleFactorLimits(float minScaleFactor, float maxScaleFac tor, ExceptionState& exceptionState) |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2670 | 2674 |
| 2671 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); | 2675 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); |
| 2672 } | 2676 } |
| 2673 | 2677 |
| 2674 void Internals::crash() | 2678 void Internals::crash() |
| 2675 { | 2679 { |
| 2676 CHECK(false) << "Intentional crash"; | 2680 CHECK(false) << "Intentional crash"; |
| 2677 } | 2681 } |
| 2678 | 2682 |
| 2679 } // namespace blink | 2683 } // namespace blink |
| OLD | NEW |