| 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 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2900 } | 2900 } |
| 2901 | 2901 |
| 2902 void RenderViewImpl::OnDisableScrollbarsForSmallWindows( | 2902 void RenderViewImpl::OnDisableScrollbarsForSmallWindows( |
| 2903 const gfx::Size& disable_scrollbar_size_limit) { | 2903 const gfx::Size& disable_scrollbar_size_limit) { |
| 2904 disable_scrollbars_size_limit_ = disable_scrollbar_size_limit; | 2904 disable_scrollbars_size_limit_ = disable_scrollbar_size_limit; |
| 2905 } | 2905 } |
| 2906 | 2906 |
| 2907 void RenderViewImpl::OnSetRendererPrefs( | 2907 void RenderViewImpl::OnSetRendererPrefs( |
| 2908 const RendererPreferences& renderer_prefs) { | 2908 const RendererPreferences& renderer_prefs) { |
| 2909 double old_zoom_level = renderer_preferences_.default_zoom_level; | 2909 double old_zoom_level = renderer_preferences_.default_zoom_level; |
| 2910 std::string old_accept_languages = renderer_preferences_.accept_languages; | |
| 2911 | |
| 2912 renderer_preferences_ = renderer_prefs; | 2910 renderer_preferences_ = renderer_prefs; |
| 2913 UpdateFontRenderingFromRendererPrefs(); | 2911 UpdateFontRenderingFromRendererPrefs(); |
| 2914 | 2912 |
| 2915 #if defined(USE_DEFAULT_RENDER_THEME) | 2913 #if defined(USE_DEFAULT_RENDER_THEME) |
| 2916 if (renderer_prefs.use_custom_colors) { | 2914 if (renderer_prefs.use_custom_colors) { |
| 2917 WebColorName name = blink::WebColorWebkitFocusRingColor; | 2915 WebColorName name = blink::WebColorWebkitFocusRingColor; |
| 2918 blink::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); | 2916 blink::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); |
| 2919 blink::setCaretBlinkInterval(renderer_prefs.caret_blink_interval); | 2917 blink::setCaretBlinkInterval(renderer_prefs.caret_blink_interval); |
| 2920 | 2918 |
| 2921 if (webview()) { | 2919 if (webview()) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2936 | 2934 |
| 2937 // If the zoom level for this page matches the old zoom default, and this | 2935 // If the zoom level for this page matches the old zoom default, and this |
| 2938 // is not a plugin, update the zoom level to match the new default. | 2936 // is not a plugin, update the zoom level to match the new default. |
| 2939 if (webview() && !webview()->mainFrame()->document().isPluginDocument() && | 2937 if (webview() && !webview()->mainFrame()->document().isPluginDocument() && |
| 2940 !ZoomValuesEqual(old_zoom_level, | 2938 !ZoomValuesEqual(old_zoom_level, |
| 2941 renderer_preferences_.default_zoom_level) && | 2939 renderer_preferences_.default_zoom_level) && |
| 2942 ZoomValuesEqual(webview()->zoomLevel(), old_zoom_level)) { | 2940 ZoomValuesEqual(webview()->zoomLevel(), old_zoom_level)) { |
| 2943 webview()->setZoomLevel(renderer_preferences_.default_zoom_level); | 2941 webview()->setZoomLevel(renderer_preferences_.default_zoom_level); |
| 2944 zoomLevelChanged(); | 2942 zoomLevelChanged(); |
| 2945 } | 2943 } |
| 2946 | |
| 2947 if (webview() && | |
| 2948 old_accept_languages != renderer_preferences_.accept_languages) { | |
| 2949 webview()->acceptLanguagesChanged(); | |
| 2950 } | |
| 2951 } | 2944 } |
| 2952 | 2945 |
| 2953 void RenderViewImpl::OnMediaPlayerActionAt(const gfx::Point& location, | 2946 void RenderViewImpl::OnMediaPlayerActionAt(const gfx::Point& location, |
| 2954 const WebMediaPlayerAction& action) { | 2947 const WebMediaPlayerAction& action) { |
| 2955 if (webview()) | 2948 if (webview()) |
| 2956 webview()->performMediaPlayerAction(action, location); | 2949 webview()->performMediaPlayerAction(action, location); |
| 2957 } | 2950 } |
| 2958 | 2951 |
| 2959 void RenderViewImpl::OnOrientationChange() { | 2952 void RenderViewImpl::OnOrientationChange() { |
| 2960 // TODO(mlamouri): consumers of that event should be using DisplayObserver. | 2953 // TODO(mlamouri): consumers of that event should be using DisplayObserver. |
| (...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4091 std::vector<gfx::Size> sizes; | 4084 std::vector<gfx::Size> sizes; |
| 4092 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4085 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4093 if (!url.isEmpty()) | 4086 if (!url.isEmpty()) |
| 4094 urls.push_back( | 4087 urls.push_back( |
| 4095 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4088 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4096 } | 4089 } |
| 4097 SendUpdateFaviconURL(urls); | 4090 SendUpdateFaviconURL(urls); |
| 4098 } | 4091 } |
| 4099 | 4092 |
| 4100 } // namespace content | 4093 } // namespace content |
| OLD | NEW |