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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 | 1878 |
1879 void RenderViewImpl::requestPointerUnlock() { | 1879 void RenderViewImpl::requestPointerUnlock() { |
1880 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); | 1880 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); |
1881 } | 1881 } |
1882 | 1882 |
1883 bool RenderViewImpl::isPointerLocked() { | 1883 bool RenderViewImpl::isPointerLocked() { |
1884 return mouse_lock_dispatcher_->IsMouseLockedTo( | 1884 return mouse_lock_dispatcher_->IsMouseLockedTo( |
1885 webwidget_mouse_lock_target_.get()); | 1885 webwidget_mouse_lock_target_.get()); |
1886 } | 1886 } |
1887 | 1887 |
1888 void RenderViewImpl::didActivateCompositor() { | |
1889 #if !defined(OS_MACOSX) // many events are unhandled - http://crbug.com/138003 | |
1890 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | |
1891 // render_thread may be NULL in tests. | |
1892 InputHandlerManager* input_handler_manager = | |
1893 render_thread ? render_thread->input_handler_manager() : NULL; | |
1894 if (input_handler_manager) { | |
1895 input_handler_manager->AddInputHandler( | |
1896 routing_id_, | |
1897 compositor_->GetInputHandler(), | |
1898 AsWeakPtr()); | |
1899 } | |
1900 #endif | |
1901 } | |
1902 | |
1903 void RenderViewImpl::didHandleGestureEvent( | 1888 void RenderViewImpl::didHandleGestureEvent( |
1904 const WebGestureEvent& event, | 1889 const WebGestureEvent& event, |
1905 bool event_cancelled) { | 1890 bool event_cancelled) { |
1906 RenderWidget::didHandleGestureEvent(event, event_cancelled); | 1891 RenderWidget::didHandleGestureEvent(event, event_cancelled); |
1907 | 1892 |
1908 if (event.type != blink::WebGestureEvent::GestureTap) | 1893 if (event.type != blink::WebGestureEvent::GestureTap) |
1909 return; | 1894 return; |
1910 | 1895 |
1911 blink::WebTextInputType text_input_type = | 1896 blink::WebTextInputType text_input_type = |
1912 GetWebView()->textInputInfo().type; | 1897 GetWebView()->textInputInfo().type; |
1913 | 1898 |
1914 Send(new ViewHostMsg_FocusedNodeTouched( | 1899 Send(new ViewHostMsg_FocusedNodeTouched( |
1915 routing_id(), text_input_type != blink::WebTextInputTypeNone)); | 1900 routing_id(), text_input_type != blink::WebTextInputTypeNone)); |
1916 } | 1901 } |
1917 | 1902 |
1918 void RenderViewImpl::initializeLayerTreeView() { | 1903 void RenderViewImpl::initializeLayerTreeView() { |
1919 RenderWidget::initializeLayerTreeView(); | 1904 RenderWidget::initializeLayerTreeView(); |
1920 RenderWidgetCompositor* rwc = compositor(); | 1905 RenderWidgetCompositor* rwc = compositor(); |
1921 if (!rwc || !webview() || !webview()->devToolsAgent()) | 1906 if (!rwc) |
1922 return; | 1907 return; |
1923 webview()->devToolsAgent()->setLayerTreeId(rwc->GetLayerTreeId()); | 1908 if (webview() && webview()->devToolsAgent()) |
| 1909 webview()->devToolsAgent()->setLayerTreeId(rwc->GetLayerTreeId()); |
| 1910 |
| 1911 #if !defined(OS_MACOSX) // many events are unhandled - http://crbug.com/138003 |
| 1912 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 1913 // render_thread may be NULL in tests. |
| 1914 InputHandlerManager* input_handler_manager = |
| 1915 render_thread ? render_thread->input_handler_manager() : NULL; |
| 1916 if (input_handler_manager) { |
| 1917 input_handler_manager->AddInputHandler( |
| 1918 routing_id_, rwc->GetInputHandler(), AsWeakPtr()); |
| 1919 } |
| 1920 #endif |
1924 } | 1921 } |
1925 | 1922 |
1926 // blink::WebFrameClient ----------------------------------------------------- | 1923 // blink::WebFrameClient ----------------------------------------------------- |
1927 | 1924 |
1928 void RenderViewImpl::Repaint(const gfx::Size& size) { | 1925 void RenderViewImpl::Repaint(const gfx::Size& size) { |
1929 OnRepaint(size); | 1926 OnRepaint(size); |
1930 } | 1927 } |
1931 | 1928 |
1932 void RenderViewImpl::SetEditCommandForNextKeyEvent(const std::string& name, | 1929 void RenderViewImpl::SetEditCommandForNextKeyEvent(const std::string& name, |
1933 const std::string& value) { | 1930 const std::string& value) { |
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4065 std::vector<gfx::Size> sizes; | 4062 std::vector<gfx::Size> sizes; |
4066 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4063 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4067 if (!url.isEmpty()) | 4064 if (!url.isEmpty()) |
4068 urls.push_back( | 4065 urls.push_back( |
4069 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4066 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4070 } | 4067 } |
4071 SendUpdateFaviconURL(urls); | 4068 SendUpdateFaviconURL(urls); |
4072 } | 4069 } |
4073 | 4070 |
4074 } // namespace content | 4071 } // namespace content |
OLD | NEW |