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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #include "content/browser/site_instance_impl.h" | 72 #include "content/browser/site_instance_impl.h" |
73 #include "content/browser/wake_lock/wake_lock_service_context.h" | 73 #include "content/browser/wake_lock/wake_lock_service_context.h" |
74 #include "content/browser/web_contents/web_contents_view_child_frame.h" | 74 #include "content/browser/web_contents/web_contents_view_child_frame.h" |
75 #include "content/browser/web_contents/web_contents_view_guest.h" | 75 #include "content/browser/web_contents/web_contents_view_guest.h" |
76 #include "content/browser/webui/generic_handler.h" | 76 #include "content/browser/webui/generic_handler.h" |
77 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 77 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
78 #include "content/browser/webui/web_ui_impl.h" | 78 #include "content/browser/webui/web_ui_impl.h" |
79 #include "content/common/browser_plugin/browser_plugin_constants.h" | 79 #include "content/common/browser_plugin/browser_plugin_constants.h" |
80 #include "content/common/browser_plugin/browser_plugin_messages.h" | 80 #include "content/common/browser_plugin/browser_plugin_messages.h" |
81 #include "content/common/frame_messages.h" | 81 #include "content/common/frame_messages.h" |
82 #include "content/common/input/web_input_event_traits.h" | |
83 #include "content/common/input_messages.h" | 82 #include "content/common/input_messages.h" |
84 #include "content/common/page_messages.h" | 83 #include "content/common/page_messages.h" |
85 #include "content/common/page_state_serialization.h" | 84 #include "content/common/page_state_serialization.h" |
86 #include "content/common/site_isolation_policy.h" | 85 #include "content/common/site_isolation_policy.h" |
87 #include "content/common/view_messages.h" | 86 #include "content/common/view_messages.h" |
88 #include "content/public/browser/ax_event_notification_details.h" | 87 #include "content/public/browser/ax_event_notification_details.h" |
89 #include "content/public/browser/browser_context.h" | 88 #include "content/public/browser/browser_context.h" |
90 #include "content/public/browser/browser_plugin_guest_manager.h" | 89 #include "content/public/browser/browser_plugin_guest_manager.h" |
91 #include "content/public/browser/content_browser_client.h" | 90 #include "content/public/browser/content_browser_client.h" |
92 #include "content/public/browser/devtools_agent_host.h" | 91 #include "content/public/browser/devtools_agent_host.h" |
(...skipping 27 matching lines...) Expand all Loading... |
120 #include "device/geolocation/geolocation_service_context.h" | 119 #include "device/geolocation/geolocation_service_context.h" |
121 #include "net/base/url_util.h" | 120 #include "net/base/url_util.h" |
122 #include "net/http/http_cache.h" | 121 #include "net/http/http_cache.h" |
123 #include "net/http/http_transaction_factory.h" | 122 #include "net/http/http_transaction_factory.h" |
124 #include "net/url_request/url_request_context.h" | 123 #include "net/url_request/url_request_context.h" |
125 #include "net/url_request/url_request_context_getter.h" | 124 #include "net/url_request/url_request_context_getter.h" |
126 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 125 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
127 #include "third_party/skia/include/core/SkBitmap.h" | 126 #include "third_party/skia/include/core/SkBitmap.h" |
128 #include "ui/accessibility/ax_tree_combiner.h" | 127 #include "ui/accessibility/ax_tree_combiner.h" |
129 #include "ui/base/layout.h" | 128 #include "ui/base/layout.h" |
| 129 #include "ui/events/blink/web_input_event_traits.h" |
130 #include "ui/gl/gl_switches.h" | 130 #include "ui/gl/gl_switches.h" |
131 | 131 |
132 #if defined(OS_ANDROID) | 132 #if defined(OS_ANDROID) |
133 #include "content/browser/android/content_video_view.h" | 133 #include "content/browser/android/content_video_view.h" |
134 #include "content/browser/android/date_time_chooser_android.h" | 134 #include "content/browser/android/date_time_chooser_android.h" |
135 #include "content/browser/media/android/media_web_contents_observer_android.h" | 135 #include "content/browser/media/android/media_web_contents_observer_android.h" |
136 #include "content/browser/web_contents/web_contents_android.h" | 136 #include "content/browser/web_contents/web_contents_android.h" |
137 #endif // OS_ANDROID | 137 #endif // OS_ANDROID |
138 | 138 |
139 #if defined(OS_MACOSX) | 139 #if defined(OS_MACOSX) |
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 bool WebContentsImpl::HandleWheelEvent( | 1771 bool WebContentsImpl::HandleWheelEvent( |
1772 const blink::WebMouseWheelEvent& event) { | 1772 const blink::WebMouseWheelEvent& event) { |
1773 #if !defined(OS_MACOSX) | 1773 #if !defined(OS_MACOSX) |
1774 // On platforms other than Mac, control+mousewheel may change zoom. On Mac, | 1774 // On platforms other than Mac, control+mousewheel may change zoom. On Mac, |
1775 // this isn't done for two reasons: | 1775 // this isn't done for two reasons: |
1776 // -the OS already has a gesture to do this through pinch-zoom | 1776 // -the OS already has a gesture to do this through pinch-zoom |
1777 // -if a user starts an inertial scroll, let's go, and presses control | 1777 // -if a user starts an inertial scroll, let's go, and presses control |
1778 // (i.e. control+tab) then the OS's buffered scroll events will come in | 1778 // (i.e. control+tab) then the OS's buffered scroll events will come in |
1779 // with control key set which isn't what the user wants | 1779 // with control key set which isn't what the user wants |
1780 if (delegate_ && event.wheelTicksY && | 1780 if (delegate_ && event.wheelTicksY && |
1781 !WebInputEventTraits::CanCauseScroll(event)) { | 1781 !ui::WebInputEventTraits::CanCauseScroll(event)) { |
1782 // Count only integer cumulative scrolls as zoom events; this handles | 1782 // Count only integer cumulative scrolls as zoom events; this handles |
1783 // smooth scroll and regular scroll device behavior. | 1783 // smooth scroll and regular scroll device behavior. |
1784 zoom_scroll_remainder_ += event.wheelTicksY; | 1784 zoom_scroll_remainder_ += event.wheelTicksY; |
1785 int whole_zoom_scroll_remainder_ = std::lround(zoom_scroll_remainder_); | 1785 int whole_zoom_scroll_remainder_ = std::lround(zoom_scroll_remainder_); |
1786 zoom_scroll_remainder_ -= whole_zoom_scroll_remainder_; | 1786 zoom_scroll_remainder_ -= whole_zoom_scroll_remainder_; |
1787 if (whole_zoom_scroll_remainder_ != 0) { | 1787 if (whole_zoom_scroll_remainder_ != 0) { |
1788 delegate_->ContentsZoomChange(whole_zoom_scroll_remainder_ > 0); | 1788 delegate_->ContentsZoomChange(whole_zoom_scroll_remainder_ > 0); |
1789 } | 1789 } |
1790 return true; | 1790 return true; |
1791 } | 1791 } |
(...skipping 3414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5206 for (RenderViewHost* render_view_host : render_view_host_set) | 5206 for (RenderViewHost* render_view_host : render_view_host_set) |
5207 render_view_host->OnWebkitPreferencesChanged(); | 5207 render_view_host->OnWebkitPreferencesChanged(); |
5208 } | 5208 } |
5209 | 5209 |
5210 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5210 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
5211 JavaScriptDialogManager* dialog_manager) { | 5211 JavaScriptDialogManager* dialog_manager) { |
5212 dialog_manager_ = dialog_manager; | 5212 dialog_manager_ = dialog_manager; |
5213 } | 5213 } |
5214 | 5214 |
5215 } // namespace content | 5215 } // namespace content |
OLD | NEW |