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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 | 415 |
| 416 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) | 416 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) |
| 417 return true; | 417 return true; |
| 418 | 418 |
| 419 // TODO(ajuma): Re-enable this by default for high-DPI once the problem | 419 // TODO(ajuma): Re-enable this by default for high-DPI once the problem |
| 420 // of excessive layer promotion caused by overlap has been addressed. | 420 // of excessive layer promotion caused by overlap has been addressed. |
| 421 // http://crbug.com/178119. | 421 // http://crbug.com/178119. |
| 422 return false; | 422 return false; |
| 423 } | 423 } |
| 424 | 424 |
| 425 static bool ShouldUseThreadedScrolling() { | |
|
jam
2014/09/23 05:12:59
this should be inlined, we normally don't add meth
jdduke (slow)
2014/09/23 19:18:11
Done.
| |
| 426 if (CommandLine::ForCurrentProcess() | |
| 427 ->HasSwitch(switches::kDisableThreadedScrolling)) { | |
| 428 return false; | |
| 429 } | |
| 430 | |
| 431 return true; | |
| 432 } | |
| 433 | |
| 425 static FaviconURL::IconType ToFaviconType(blink::WebIconURL::Type type) { | 434 static FaviconURL::IconType ToFaviconType(blink::WebIconURL::Type type) { |
| 426 switch (type) { | 435 switch (type) { |
| 427 case blink::WebIconURL::TypeFavicon: | 436 case blink::WebIconURL::TypeFavicon: |
| 428 return FaviconURL::FAVICON; | 437 return FaviconURL::FAVICON; |
| 429 case blink::WebIconURL::TypeTouch: | 438 case blink::WebIconURL::TypeTouch: |
| 430 return FaviconURL::TOUCH_ICON; | 439 return FaviconURL::TOUCH_ICON; |
| 431 case blink::WebIconURL::TypeTouchPrecomposed: | 440 case blink::WebIconURL::TypeTouchPrecomposed: |
| 432 return FaviconURL::TOUCH_PRECOMPOSED_ICON; | 441 return FaviconURL::TOUCH_PRECOMPOSED_ICON; |
| 433 case blink::WebIconURL::TypeInvalid: | 442 case blink::WebIconURL::TypeInvalid: |
| 434 return FaviconURL::INVALID_ICON; | 443 return FaviconURL::INVALID_ICON; |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 752 CompleteInit(); | 761 CompleteInit(); |
| 753 } | 762 } |
| 754 | 763 |
| 755 g_view_map.Get().insert(std::make_pair(webview(), this)); | 764 g_view_map.Get().insert(std::make_pair(webview(), this)); |
| 756 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); | 765 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); |
| 757 webview()->setDeviceScaleFactor(device_scale_factor_); | 766 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 758 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 767 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
| 759 PreferCompositingToLCDText(device_scale_factor_)); | 768 PreferCompositingToLCDText(device_scale_factor_)); |
| 760 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 769 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
| 761 ShouldUseTransitionCompositing(device_scale_factor_)); | 770 ShouldUseTransitionCompositing(device_scale_factor_)); |
| 771 webview()->settings()->setThreadedScrollingEnabled( | |
| 772 ShouldUseThreadedScrolling()); | |
| 762 | 773 |
| 763 ApplyWebPreferences(webkit_preferences_, webview()); | 774 ApplyWebPreferences(webkit_preferences_, webview()); |
| 764 | 775 |
| 765 webview()->settings()->setAllowConnectingInsecureWebSocket( | 776 webview()->settings()->setAllowConnectingInsecureWebSocket( |
| 766 command_line.HasSwitch(switches::kAllowInsecureWebSocketFromHttpsOrigin)); | 777 command_line.HasSwitch(switches::kAllowInsecureWebSocketFromHttpsOrigin)); |
| 767 | 778 |
| 768 RenderFrameProxy* proxy = NULL; | 779 RenderFrameProxy* proxy = NULL; |
| 769 if (params->proxy_routing_id != MSG_ROUTING_NONE) { | 780 if (params->proxy_routing_id != MSG_ROUTING_NONE) { |
| 770 CHECK(params->swapped_out); | 781 CHECK(params->swapped_out); |
| 771 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( | 782 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( |
| (...skipping 3444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4216 std::vector<gfx::Size> sizes; | 4227 std::vector<gfx::Size> sizes; |
| 4217 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4228 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4218 if (!url.isEmpty()) | 4229 if (!url.isEmpty()) |
| 4219 urls.push_back( | 4230 urls.push_back( |
| 4220 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4231 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4221 } | 4232 } |
| 4222 SendUpdateFaviconURL(urls); | 4233 SendUpdateFaviconURL(urls); |
| 4223 } | 4234 } |
| 4224 | 4235 |
| 4225 } // namespace content | 4236 } // namespace content |
| OLD | NEW |