| 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 2742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2753 | 2753 |
| 2754 bool zoom_in_to_legible_scale = | 2754 bool zoom_in_to_legible_scale = |
| 2755 web_settings_->AutoZoomFocusedNodeToLegibleScale() && | 2755 web_settings_->AutoZoomFocusedNodeToLegibleScale() && |
| 2756 !GetPage()->GetVisualViewport().ShouldDisableDesktopWorkarounds(); | 2756 !GetPage()->GetVisualViewport().ShouldDisableDesktopWorkarounds(); |
| 2757 | 2757 |
| 2758 if (zoom_in_to_legible_scale) { | 2758 if (zoom_in_to_legible_scale) { |
| 2759 // When deciding whether to zoom in on a focused text box, we should decide | 2759 // When deciding whether to zoom in on a focused text box, we should decide |
| 2760 // not to zoom in if the user won't be able to zoom out. e.g if the textbox | 2760 // not to zoom in if the user won't be able to zoom out. e.g if the textbox |
| 2761 // is within a touch-action: none container the user can't zoom back out. | 2761 // is within a touch-action: none container the user can't zoom back out. |
| 2762 TouchAction action = TouchActionUtil::ComputeEffectiveTouchAction(*element); | 2762 TouchAction action = TouchActionUtil::ComputeEffectiveTouchAction(*element); |
| 2763 if (!(action & kTouchActionPinchZoom)) | 2763 if (!(action & TouchAction::kTouchActionPinchZoom)) |
| 2764 zoom_in_to_legible_scale = false; | 2764 zoom_in_to_legible_scale = false; |
| 2765 } | 2765 } |
| 2766 | 2766 |
| 2767 float scale; | 2767 float scale; |
| 2768 IntPoint scroll; | 2768 IntPoint scroll; |
| 2769 bool need_animation; | 2769 bool need_animation; |
| 2770 ComputeScaleAndScrollForFocusedNode(element, zoom_in_to_legible_scale, scale, | 2770 ComputeScaleAndScrollForFocusedNode(element, zoom_in_to_legible_scale, scale, |
| 2771 scroll, need_animation); | 2771 scroll, need_animation); |
| 2772 if (need_animation) | 2772 if (need_animation) |
| 2773 StartPageScaleAnimation(scroll, false, scale, | 2773 StartPageScaleAnimation(scroll, false, scale, |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4169 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4169 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
| 4170 return nullptr; | 4170 return nullptr; |
| 4171 return focused_frame; | 4171 return focused_frame; |
| 4172 } | 4172 } |
| 4173 | 4173 |
| 4174 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4174 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
| 4175 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4175 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
| 4176 } | 4176 } |
| 4177 | 4177 |
| 4178 } // namespace blink | 4178 } // namespace blink |
| OLD | NEW |