| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 #include "wtf/CurrentTime.h" | 104 #include "wtf/CurrentTime.h" |
| 105 #include "wtf/RefPtr.h" | 105 #include "wtf/RefPtr.h" |
| 106 #include "wtf/TemporaryChange.h" | 106 #include "wtf/TemporaryChange.h" |
| 107 | 107 |
| 108 // Get rid of WTF's pow define so we can use std::pow. | 108 // Get rid of WTF's pow define so we can use std::pow. |
| 109 #undef pow | 109 #undef pow |
| 110 #include <cmath> // for std::pow | 110 #include <cmath> // for std::pow |
| 111 | 111 |
| 112 namespace blink { | 112 namespace blink { |
| 113 | 113 |
| 114 // Change the text zoom level by kTextSizeMultiplierRatio each time the user | |
| 115 // zooms text in or out (ie., change by 20%). The min and max values limit | |
| 116 // text zoom to half and 3x the original text size. These three values match | |
| 117 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm | |
| 118 const double WebView::textSizeMultiplierRatio = 1.2; | |
| 119 const double WebView::minTextSizeMultiplier = 0.5; | |
| 120 const double WebView::maxTextSizeMultiplier = 3.0; | |
| 121 | |
| 122 // WebView ---------------------------------------------------------------- | 114 // WebView ---------------------------------------------------------------- |
| 123 | 115 |
| 124 WebView* WebView::create(WebViewClient* client) | 116 WebView* WebView::create(WebViewClient* client) |
| 125 { | 117 { |
| 126 // Pass the WebViewImpl's self-reference to the caller. | 118 // Pass the WebViewImpl's self-reference to the caller. |
| 127 return WebViewImpl::create(client); | 119 return WebViewImpl::create(client); |
| 128 } | 120 } |
| 129 | 121 |
| 130 WebViewImpl* WebViewImpl::create(WebViewClient* client) | 122 WebViewImpl* WebViewImpl::create(WebViewClient* client) |
| 131 { | 123 { |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 // Safari documentation for -webkit-tap-highlight-color says if the spec
ified color has 0 alpha, | 725 // Safari documentation for -webkit-tap-highlight-color says if the spec
ified color has 0 alpha, |
| 734 // then tap highlighting is disabled. | 726 // then tap highlighting is disabled. |
| 735 // http://developer.apple.com/library/safari/#documentation/appleapplica
tions/reference/safaricssref/articles/standardcssproperties.html | 727 // http://developer.apple.com/library/safari/#documentation/appleapplica
tions/reference/safaricssref/articles/standardcssproperties.html |
| 736 if (!highlightColor.alpha()) | 728 if (!highlightColor.alpha()) |
| 737 continue; | 729 continue; |
| 738 | 730 |
| 739 m_linkHighlights.append(LinkHighlight::create(node, this)); | 731 m_linkHighlights.append(LinkHighlight::create(node, this)); |
| 740 } | 732 } |
| 741 } | 733 } |
| 742 | 734 |
| 743 void WebViewImpl::animateDoubleTapZoom(const IntPoint& point) | |
| 744 { | |
| 745 //FIXME(sky) | |
| 746 } | |
| 747 | |
| 748 void WebViewImpl::zoomToFindInPageRect(const WebRect& rect) | |
| 749 { | |
| 750 //FIXME(sky) | |
| 751 } | |
| 752 | |
| 753 bool WebViewImpl::zoomToMultipleTargetsRect(const WebRect& rect) | |
| 754 { | |
| 755 return false; | |
| 756 } | |
| 757 | |
| 758 bool WebViewImpl::keyEventDefault(const WebKeyboardEvent& event) | 735 bool WebViewImpl::keyEventDefault(const WebKeyboardEvent& event) |
| 759 { | 736 { |
| 760 LocalFrame* frame = focusedCoreFrame(); | 737 LocalFrame* frame = focusedCoreFrame(); |
| 761 if (!frame) | 738 if (!frame) |
| 762 return false; | 739 return false; |
| 763 | 740 |
| 764 switch (event.type) { | 741 switch (event.type) { |
| 765 case WebInputEvent::Char: | 742 case WebInputEvent::Char: |
| 766 if (event.windowsKeyCode == VKEY_SPACE) { | 743 if (event.windowsKeyCode == VKEY_SPACE) { |
| 767 int keyCode = ((event.modifiers & WebInputEvent::ShiftKey) ? VKEY_PR
IOR : VKEY_NEXT); | 744 int keyCode = ((event.modifiers & WebInputEvent::ShiftKey) ? VKEY_PR
IOR : VKEY_NEXT); |
| (...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2293 m_layerTreeView->setVisible(visible); | 2270 m_layerTreeView->setVisible(visible); |
| 2294 } | 2271 } |
| 2295 } | 2272 } |
| 2296 | 2273 |
| 2297 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 2274 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 2298 { | 2275 { |
| 2299 return true; | 2276 return true; |
| 2300 } | 2277 } |
| 2301 | 2278 |
| 2302 } // namespace blink | 2279 } // namespace blink |
| OLD | NEW |