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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 if (browser_plugin_embedder_ && | 1148 if (browser_plugin_embedder_ && |
1149 browser_plugin_embedder_->HandleKeyboardEvent(event)) { | 1149 browser_plugin_embedder_->HandleKeyboardEvent(event)) { |
1150 return; | 1150 return; |
1151 } | 1151 } |
1152 | 1152 |
1153 if (delegate_) | 1153 if (delegate_) |
1154 delegate_->HandleKeyboardEvent(this, event); | 1154 delegate_->HandleKeyboardEvent(this, event); |
1155 } | 1155 } |
1156 | 1156 |
1157 bool WebContentsImpl::PreHandleWheelEvent( | 1157 bool WebContentsImpl::PreHandleWheelEvent( |
1158 const WebKit::WebMouseWheelEvent& event) { | 1158 const blink::WebMouseWheelEvent& event) { |
1159 #if !defined(OS_MACOSX) | 1159 #if !defined(OS_MACOSX) |
1160 // On platforms other than Mac, control+mousewheel changes zoom. On Mac, this | 1160 // On platforms other than Mac, control+mousewheel changes zoom. On Mac, this |
1161 // isn't done for two reasons: | 1161 // isn't done for two reasons: |
1162 // -the OS already has a gesture to do this through pinch-zoom | 1162 // -the OS already has a gesture to do this through pinch-zoom |
1163 // -if a user starts an inertial scroll, let's go, and presses control | 1163 // -if a user starts an inertial scroll, let's go, and presses control |
1164 // (i.e. control+tab) then the OS's buffered scroll events will come in | 1164 // (i.e. control+tab) then the OS's buffered scroll events will come in |
1165 // with control key set which isn't what the user wants | 1165 // with control key set which isn't what the user wants |
1166 if (delegate_ && | 1166 if (delegate_ && |
1167 event.wheelTicksY && | 1167 event.wheelTicksY && |
1168 (event.modifiers & WebKit::WebInputEvent::ControlKey)) { | 1168 (event.modifiers & blink::WebInputEvent::ControlKey)) { |
1169 delegate_->ContentsZoomChange(event.wheelTicksY > 0); | 1169 delegate_->ContentsZoomChange(event.wheelTicksY > 0); |
1170 return true; | 1170 return true; |
1171 } | 1171 } |
1172 #endif | 1172 #endif |
1173 | 1173 |
1174 return false; | 1174 return false; |
1175 } | 1175 } |
1176 | 1176 |
1177 #if defined(OS_WIN) && defined(USE_AURA) | 1177 #if defined(OS_WIN) && defined(USE_AURA) |
1178 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() { | 1178 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 CURRENT_TAB, | 1347 CURRENT_TAB, |
1348 PAGE_TRANSITION_LINK, | 1348 PAGE_TRANSITION_LINK, |
1349 true /* is_renderer_initiated */); | 1349 true /* is_renderer_initiated */); |
1350 open_params.user_gesture = params.user_gesture; | 1350 open_params.user_gesture = params.user_gesture; |
1351 new_contents->OpenURL(open_params); | 1351 new_contents->OpenURL(open_params); |
1352 } | 1352 } |
1353 } | 1353 } |
1354 } | 1354 } |
1355 | 1355 |
1356 void WebContentsImpl::CreateNewWidget(int route_id, | 1356 void WebContentsImpl::CreateNewWidget(int route_id, |
1357 WebKit::WebPopupType popup_type) { | 1357 blink::WebPopupType popup_type) { |
1358 CreateNewWidget(route_id, false, popup_type); | 1358 CreateNewWidget(route_id, false, popup_type); |
1359 } | 1359 } |
1360 | 1360 |
1361 void WebContentsImpl::CreateNewFullscreenWidget(int route_id) { | 1361 void WebContentsImpl::CreateNewFullscreenWidget(int route_id) { |
1362 CreateNewWidget(route_id, true, WebKit::WebPopupTypeNone); | 1362 CreateNewWidget(route_id, true, blink::WebPopupTypeNone); |
1363 } | 1363 } |
1364 | 1364 |
1365 void WebContentsImpl::CreateNewWidget(int route_id, | 1365 void WebContentsImpl::CreateNewWidget(int route_id, |
1366 bool is_fullscreen, | 1366 bool is_fullscreen, |
1367 WebKit::WebPopupType popup_type) { | 1367 blink::WebPopupType popup_type) { |
1368 RenderProcessHost* process = GetRenderProcessHost(); | 1368 RenderProcessHost* process = GetRenderProcessHost(); |
1369 RenderWidgetHostImpl* widget_host = | 1369 RenderWidgetHostImpl* widget_host = |
1370 new RenderWidgetHostImpl(this, process, route_id, IsHidden()); | 1370 new RenderWidgetHostImpl(this, process, route_id, IsHidden()); |
1371 created_widgets_.insert(widget_host); | 1371 created_widgets_.insert(widget_host); |
1372 | 1372 |
1373 RenderWidgetHostViewPort* widget_view = RenderWidgetHostViewPort::FromRWHV( | 1373 RenderWidgetHostViewPort* widget_view = RenderWidgetHostViewPort::FromRWHV( |
1374 view_->CreateViewForPopupWidget(widget_host)); | 1374 view_->CreateViewForPopupWidget(widget_host)); |
1375 if (!widget_view) | 1375 if (!widget_view) |
1376 return; | 1376 return; |
1377 if (!is_fullscreen) { | 1377 if (!is_fullscreen) { |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1802 | 1802 |
1803 RendererPreferences* WebContentsImpl::GetMutableRendererPrefs() { | 1803 RendererPreferences* WebContentsImpl::GetMutableRendererPrefs() { |
1804 return &renderer_preferences_; | 1804 return &renderer_preferences_; |
1805 } | 1805 } |
1806 | 1806 |
1807 void WebContentsImpl::Close() { | 1807 void WebContentsImpl::Close() { |
1808 Close(GetRenderViewHost()); | 1808 Close(GetRenderViewHost()); |
1809 } | 1809 } |
1810 | 1810 |
1811 void WebContentsImpl::DragSourceEndedAt(int client_x, int client_y, | 1811 void WebContentsImpl::DragSourceEndedAt(int client_x, int client_y, |
1812 int screen_x, int screen_y, WebKit::WebDragOperation operation) { | 1812 int screen_x, int screen_y, blink::WebDragOperation operation) { |
1813 if (browser_plugin_embedder_.get()) | 1813 if (browser_plugin_embedder_.get()) |
1814 browser_plugin_embedder_->DragSourceEndedAt(client_x, client_y, | 1814 browser_plugin_embedder_->DragSourceEndedAt(client_x, client_y, |
1815 screen_x, screen_y, operation); | 1815 screen_x, screen_y, operation); |
1816 if (GetRenderViewHost()) | 1816 if (GetRenderViewHost()) |
1817 GetRenderViewHostImpl()->DragSourceEndedAt(client_x, client_y, | 1817 GetRenderViewHostImpl()->DragSourceEndedAt(client_x, client_y, |
1818 screen_x, screen_y, operation); | 1818 screen_x, screen_y, operation); |
1819 } | 1819 } |
1820 | 1820 |
1821 void WebContentsImpl::DragSourceMovedTo(int client_x, int client_y, | 1821 void WebContentsImpl::DragSourceMovedTo(int client_x, int client_y, |
1822 int screen_x, int screen_y) { | 1822 int screen_x, int screen_y) { |
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3650 } | 3650 } |
3651 | 3651 |
3652 void WebContentsImpl::OnFrameRemoved( | 3652 void WebContentsImpl::OnFrameRemoved( |
3653 RenderViewHostImpl* render_view_host, | 3653 RenderViewHostImpl* render_view_host, |
3654 int64 frame_id) { | 3654 int64 frame_id) { |
3655 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3655 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3656 FrameDetached(render_view_host, frame_id)); | 3656 FrameDetached(render_view_host, frame_id)); |
3657 } | 3657 } |
3658 | 3658 |
3659 } // namespace content | 3659 } // namespace content |
OLD | NEW |