Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 280953002: Content side of languagechange event fired on accept languages changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reset Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/shell/renderer/test_runner/test_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2897 matching lines...) Expand 10 before | Expand all | Expand 10 after
2908 } 2908 }
2909 2909
2910 void RenderViewImpl::OnDisableScrollbarsForSmallWindows( 2910 void RenderViewImpl::OnDisableScrollbarsForSmallWindows(
2911 const gfx::Size& disable_scrollbar_size_limit) { 2911 const gfx::Size& disable_scrollbar_size_limit) {
2912 disable_scrollbars_size_limit_ = disable_scrollbar_size_limit; 2912 disable_scrollbars_size_limit_ = disable_scrollbar_size_limit;
2913 } 2913 }
2914 2914
2915 void RenderViewImpl::OnSetRendererPrefs( 2915 void RenderViewImpl::OnSetRendererPrefs(
2916 const RendererPreferences& renderer_prefs) { 2916 const RendererPreferences& renderer_prefs) {
2917 double old_zoom_level = renderer_preferences_.default_zoom_level; 2917 double old_zoom_level = renderer_preferences_.default_zoom_level;
2918 std::string old_accept_languages = renderer_preferences_.accept_languages;
2919
2918 renderer_preferences_ = renderer_prefs; 2920 renderer_preferences_ = renderer_prefs;
2919 UpdateFontRenderingFromRendererPrefs(); 2921 UpdateFontRenderingFromRendererPrefs();
2920 2922
2921 #if defined(USE_DEFAULT_RENDER_THEME) 2923 #if defined(USE_DEFAULT_RENDER_THEME)
2922 if (renderer_prefs.use_custom_colors) { 2924 if (renderer_prefs.use_custom_colors) {
2923 WebColorName name = blink::WebColorWebkitFocusRingColor; 2925 WebColorName name = blink::WebColorWebkitFocusRingColor;
2924 blink::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); 2926 blink::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1);
2925 blink::setCaretBlinkInterval(renderer_prefs.caret_blink_interval); 2927 blink::setCaretBlinkInterval(renderer_prefs.caret_blink_interval);
2926 2928
2927 if (webview()) { 2929 if (webview()) {
(...skipping 14 matching lines...) Expand all
2942 2944
2943 // If the zoom level for this page matches the old zoom default, and this 2945 // If the zoom level for this page matches the old zoom default, and this
2944 // is not a plugin, update the zoom level to match the new default. 2946 // is not a plugin, update the zoom level to match the new default.
2945 if (webview() && !webview()->mainFrame()->document().isPluginDocument() && 2947 if (webview() && !webview()->mainFrame()->document().isPluginDocument() &&
2946 !ZoomValuesEqual(old_zoom_level, 2948 !ZoomValuesEqual(old_zoom_level,
2947 renderer_preferences_.default_zoom_level) && 2949 renderer_preferences_.default_zoom_level) &&
2948 ZoomValuesEqual(webview()->zoomLevel(), old_zoom_level)) { 2950 ZoomValuesEqual(webview()->zoomLevel(), old_zoom_level)) {
2949 webview()->setZoomLevel(renderer_preferences_.default_zoom_level); 2951 webview()->setZoomLevel(renderer_preferences_.default_zoom_level);
2950 zoomLevelChanged(); 2952 zoomLevelChanged();
2951 } 2953 }
2954
2955 if (webview() &&
2956 old_accept_languages != renderer_preferences_.accept_languages) {
2957 webview()->acceptLanguagesChanged();
jochen (gone - plz use gerrit) 2014/05/23 13:12:09 this API doesn't exist yet, no?
mlamouri (slow - plz ping) 2014/05/23 13:15:17 It is being added in https://codereview.chromium.o
2958 }
2952 } 2959 }
2953 2960
2954 void RenderViewImpl::OnMediaPlayerActionAt(const gfx::Point& location, 2961 void RenderViewImpl::OnMediaPlayerActionAt(const gfx::Point& location,
2955 const WebMediaPlayerAction& action) { 2962 const WebMediaPlayerAction& action) {
2956 if (webview()) 2963 if (webview())
2957 webview()->performMediaPlayerAction(action, location); 2964 webview()->performMediaPlayerAction(action, location);
2958 } 2965 }
2959 2966
2960 void RenderViewImpl::OnOrientationChange() { 2967 void RenderViewImpl::OnOrientationChange() {
2961 // TODO(mlamouri): consumers of that event should be using DisplayObserver. 2968 // TODO(mlamouri): consumers of that event should be using DisplayObserver.
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
4087 std::vector<gfx::Size> sizes; 4094 std::vector<gfx::Size> sizes;
4088 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4095 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4089 if (!url.isEmpty()) 4096 if (!url.isEmpty())
4090 urls.push_back( 4097 urls.push_back(
4091 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4098 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4092 } 4099 }
4093 SendUpdateFaviconURL(urls); 4100 SendUpdateFaviconURL(urls);
4094 } 4101 }
4095 4102
4096 } // namespace content 4103 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/shell/renderer/test_runner/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698