| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 1152 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 1153 if (browser_plugin_embedder_ && | 1153 if (browser_plugin_embedder_ && |
| 1154 browser_plugin_embedder_->HandleKeyboardEvent(event)) { | 1154 browser_plugin_embedder_->HandleKeyboardEvent(event)) { |
| 1155 return; | 1155 return; |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 if (delegate_) | 1158 if (delegate_) |
| 1159 delegate_->HandleKeyboardEvent(this, event); | 1159 delegate_->HandleKeyboardEvent(this, event); |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 bool WebContentsImpl::PreHandleWheelEvent( | 1162 bool WebContentsImpl::HandleWheelEvent( |
| 1163 const blink::WebMouseWheelEvent& event) { | 1163 const blink::WebMouseWheelEvent& event) { |
| 1164 #if !defined(OS_MACOSX) | 1164 #if !defined(OS_MACOSX) |
| 1165 // On platforms other than Mac, control+mousewheel changes zoom. On Mac, this | 1165 // On platforms other than Mac, control+mousewheel changes zoom. On Mac, this |
| 1166 // isn't done for two reasons: | 1166 // isn't done for two reasons: |
| 1167 // -the OS already has a gesture to do this through pinch-zoom | 1167 // -the OS already has a gesture to do this through pinch-zoom |
| 1168 // -if a user starts an inertial scroll, let's go, and presses control | 1168 // -if a user starts an inertial scroll, let's go, and presses control |
| 1169 // (i.e. control+tab) then the OS's buffered scroll events will come in | 1169 // (i.e. control+tab) then the OS's buffered scroll events will come in |
| 1170 // with control key set which isn't what the user wants | 1170 // with control key set which isn't what the user wants |
| 1171 if (delegate_ && | 1171 if (delegate_ && |
| 1172 event.wheelTicksY && | 1172 event.wheelTicksY && |
| 1173 (event.modifiers & blink::WebInputEvent::ControlKey)) { | 1173 (event.modifiers & blink::WebInputEvent::ControlKey)) { |
| 1174 delegate_->ContentsZoomChange(event.wheelTicksY > 0); | 1174 delegate_->ContentsZoomChange(event.wheelTicksY > 0); |
| 1175 return true; | 1175 return true; |
| 1176 } | 1176 } |
| 1177 #endif | 1177 #endif |
| 1178 | |
| 1179 return false; | 1178 return false; |
| 1180 } | 1179 } |
| 1181 | 1180 |
| 1182 bool WebContentsImpl::PreHandleGestureEvent( | 1181 bool WebContentsImpl::PreHandleGestureEvent( |
| 1183 const blink::WebGestureEvent& event) { | 1182 const blink::WebGestureEvent& event) { |
| 1184 return delegate_ && delegate_->PreHandleGestureEvent(this, event); | 1183 return delegate_ && delegate_->PreHandleGestureEvent(this, event); |
| 1185 } | 1184 } |
| 1186 | 1185 |
| 1187 #if defined(OS_WIN) | 1186 #if defined(OS_WIN) |
| 1188 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() { | 1187 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() { |
| (...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3662 | 3661 |
| 3663 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3662 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
| 3664 if (!delegate_) | 3663 if (!delegate_) |
| 3665 return; | 3664 return; |
| 3666 const gfx::Size new_size = GetPreferredSize(); | 3665 const gfx::Size new_size = GetPreferredSize(); |
| 3667 if (new_size != old_size) | 3666 if (new_size != old_size) |
| 3668 delegate_->UpdatePreferredSize(this, new_size); | 3667 delegate_->UpdatePreferredSize(this, new_size); |
| 3669 } | 3668 } |
| 3670 | 3669 |
| 3671 } // namespace content | 3670 } // namespace content |
| OLD | NEW |