| 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 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2127 } | 2127 } |
| 2128 | 2128 |
| 2129 void RenderViewImpl::initializeLayerTreeView() { | 2129 void RenderViewImpl::initializeLayerTreeView() { |
| 2130 RenderWidget::initializeLayerTreeView(); | 2130 RenderWidget::initializeLayerTreeView(); |
| 2131 RenderWidgetCompositor* rwc = compositor(); | 2131 RenderWidgetCompositor* rwc = compositor(); |
| 2132 if (!rwc) | 2132 if (!rwc) |
| 2133 return; | 2133 return; |
| 2134 if (webview() && webview()->devToolsAgent()) | 2134 if (webview() && webview()->devToolsAgent()) |
| 2135 webview()->devToolsAgent()->setLayerTreeId(rwc->GetLayerTreeId()); | 2135 webview()->devToolsAgent()->setLayerTreeId(rwc->GetLayerTreeId()); |
| 2136 | 2136 |
| 2137 #if !defined(OS_MACOSX) // many events are unhandled - http://crbug.com/138003 | 2137 bool use_threaded_event_handling = true; |
| 2138 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 2138 #if defined(OS_MACOSX) |
| 2139 // render_thread may be NULL in tests. | 2139 // Development flag because many events are still unhandled on Mac. |
| 2140 InputHandlerManager* input_handler_manager = | 2140 // http://crbug.com/138003 |
| 2141 render_thread ? render_thread->input_handler_manager() : NULL; | 2141 use_threaded_event_handling = CommandLine::ForCurrentProcess()->HasSwitch( |
| 2142 if (input_handler_manager) { | 2142 switches::kEnableThreadedEventHandlingMac); |
| 2143 input_handler_manager->AddInputHandler( | 2143 #endif |
| 2144 routing_id_, rwc->GetInputHandler(), AsWeakPtr()); | 2144 if (use_threaded_event_handling) { |
| 2145 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 2146 // render_thread may be NULL in tests. |
| 2147 InputHandlerManager* input_handler_manager = |
| 2148 render_thread ? render_thread->input_handler_manager() : NULL; |
| 2149 if (input_handler_manager) { |
| 2150 input_handler_manager->AddInputHandler( |
| 2151 routing_id_, rwc->GetInputHandler(), AsWeakPtr()); |
| 2152 } |
| 2145 } | 2153 } |
| 2146 #endif | |
| 2147 } | 2154 } |
| 2148 | 2155 |
| 2149 // blink::WebFrameClient ----------------------------------------------------- | 2156 // blink::WebFrameClient ----------------------------------------------------- |
| 2150 | 2157 |
| 2151 void RenderViewImpl::Repaint(const gfx::Size& size) { | 2158 void RenderViewImpl::Repaint(const gfx::Size& size) { |
| 2152 OnRepaint(size); | 2159 OnRepaint(size); |
| 2153 } | 2160 } |
| 2154 | 2161 |
| 2155 void RenderViewImpl::SetEditCommandForNextKeyEvent(const std::string& name, | 2162 void RenderViewImpl::SetEditCommandForNextKeyEvent(const std::string& name, |
| 2156 const std::string& value) { | 2163 const std::string& value) { |
| (...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4195 std::vector<gfx::Size> sizes; | 4202 std::vector<gfx::Size> sizes; |
| 4196 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4203 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4197 if (!url.isEmpty()) | 4204 if (!url.isEmpty()) |
| 4198 urls.push_back( | 4205 urls.push_back( |
| 4199 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4206 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4200 } | 4207 } |
| 4201 SendUpdateFaviconURL(urls); | 4208 SendUpdateFaviconURL(urls); |
| 4202 } | 4209 } |
| 4203 | 4210 |
| 4204 } // namespace content | 4211 } // namespace content |
| OLD | NEW |