Chromium Code Reviews| 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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 722 #endif | 722 #endif |
| 723 | 723 |
| 724 RenderThread::Get()->AddRoute(routing_id_, this); | 724 RenderThread::Get()->AddRoute(routing_id_, this); |
| 725 // Take a reference on behalf of the RenderThread. This will be balanced | 725 // Take a reference on behalf of the RenderThread. This will be balanced |
| 726 // when we receive ViewMsg_ClosePage. | 726 // when we receive ViewMsg_ClosePage. |
| 727 AddRef(); | 727 AddRef(); |
| 728 if (RenderThreadImpl::current()) { | 728 if (RenderThreadImpl::current()) { |
| 729 RenderThreadImpl::current()->WidgetCreated(); | 729 RenderThreadImpl::current()->WidgetCreated(); |
| 730 if (is_hidden_) | 730 if (is_hidden_) |
| 731 RenderThreadImpl::current()->WidgetHidden(); | 731 RenderThreadImpl::current()->WidgetHidden(); |
| 732 | |
| 733 #if !defined(OS_MACOSX) // many events are unhandled - http://crbug.com/138003 | |
| 734 InputHandlerManager* input_handler_manager = | |
| 735 RenderThreadImpl::current()->input_handler_manager(); | |
| 736 if (input_handler_manager) { | |
| 737 input_handler_manager->AddInputHandler( | |
| 738 routing_id_, | |
| 739 compositor_->GetInputHandler(), | |
|
piman
2014/05/22 00:12:24
Do we have compositor_ this early? I thought it wa
enne (OOO)
2014/05/27 20:40:32
It's started in CompleteInit, but created in initi
| |
| 740 AsWeakPtr()); | |
| 741 } | |
| 742 #endif | |
| 732 } | 743 } |
| 733 | 744 |
| 734 // If this is a popup, we must wait for the CreatingNew_ACK message before | 745 // If this is a popup, we must wait for the CreatingNew_ACK message before |
| 735 // completing initialization. Otherwise, we can finish it now. | 746 // completing initialization. Otherwise, we can finish it now. |
| 736 if (opener_id_ == MSG_ROUTING_NONE) { | 747 if (opener_id_ == MSG_ROUTING_NONE) { |
| 737 did_show_ = true; | 748 did_show_ = true; |
| 738 CompleteInit(); | 749 CompleteInit(); |
| 739 } | 750 } |
| 740 | 751 |
| 741 g_view_map.Get().insert(std::make_pair(webview(), this)); | 752 g_view_map.Get().insert(std::make_pair(webview(), this)); |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1912 | 1923 |
| 1913 void RenderViewImpl::requestPointerUnlock() { | 1924 void RenderViewImpl::requestPointerUnlock() { |
| 1914 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); | 1925 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); |
| 1915 } | 1926 } |
| 1916 | 1927 |
| 1917 bool RenderViewImpl::isPointerLocked() { | 1928 bool RenderViewImpl::isPointerLocked() { |
| 1918 return mouse_lock_dispatcher_->IsMouseLockedTo( | 1929 return mouse_lock_dispatcher_->IsMouseLockedTo( |
| 1919 webwidget_mouse_lock_target_.get()); | 1930 webwidget_mouse_lock_target_.get()); |
| 1920 } | 1931 } |
| 1921 | 1932 |
| 1922 void RenderViewImpl::didActivateCompositor() { | |
| 1923 #if !defined(OS_MACOSX) // many events are unhandled - http://crbug.com/138003 | |
| 1924 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | |
| 1925 // render_thread may be NULL in tests. | |
| 1926 InputHandlerManager* input_handler_manager = | |
| 1927 render_thread ? render_thread->input_handler_manager() : NULL; | |
| 1928 if (input_handler_manager) { | |
| 1929 input_handler_manager->AddInputHandler( | |
| 1930 routing_id_, | |
| 1931 compositor_->GetInputHandler(), | |
| 1932 AsWeakPtr()); | |
| 1933 } | |
| 1934 #endif | |
| 1935 } | |
| 1936 | |
| 1937 void RenderViewImpl::didHandleGestureEvent( | 1933 void RenderViewImpl::didHandleGestureEvent( |
| 1938 const WebGestureEvent& event, | 1934 const WebGestureEvent& event, |
| 1939 bool event_cancelled) { | 1935 bool event_cancelled) { |
| 1940 RenderWidget::didHandleGestureEvent(event, event_cancelled); | 1936 RenderWidget::didHandleGestureEvent(event, event_cancelled); |
| 1941 | 1937 |
| 1942 if (event.type != blink::WebGestureEvent::GestureTap) | 1938 if (event.type != blink::WebGestureEvent::GestureTap) |
| 1943 return; | 1939 return; |
| 1944 | 1940 |
| 1945 blink::WebTextInputType text_input_type = | 1941 blink::WebTextInputType text_input_type = |
| 1946 GetWebView()->textInputInfo().type; | 1942 GetWebView()->textInputInfo().type; |
| (...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4087 std::vector<gfx::Size> sizes; | 4083 std::vector<gfx::Size> sizes; |
| 4088 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4084 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4089 if (!url.isEmpty()) | 4085 if (!url.isEmpty()) |
| 4090 urls.push_back( | 4086 urls.push_back( |
| 4091 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4087 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4092 } | 4088 } |
| 4093 SendUpdateFaviconURL(urls); | 4089 SendUpdateFaviconURL(urls); |
| 4094 } | 4090 } |
| 4095 | 4091 |
| 4096 } // namespace content | 4092 } // namespace content |
| OLD | NEW |