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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 2905433002: Refresh the Incognito NTP layout on default font size change (Closed)
Patch Set: s/tooWide/too-wide/ Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/new_tab_ui.cc
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index bfd04a8022b91cf3fc2a8900af00dd12fb32b9c7..fbd429bc2533035641eaaa4a230d089ddad49d3d 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h"
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h"
#include "chrome/browser/ui/webui/theme_handler.h"
+#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/prefs/pref_service.h"
@@ -64,6 +65,9 @@ NewTabUI::NewTabUI(content::WebUI* web_ui) : content::WebUIController(web_ui) {
pref_change_registrar_.Add(bookmarks::prefs::kShowBookmarkBar,
base::Bind(&NewTabUI::OnShowBookmarkBarChanged,
base::Unretained(this)));
+ pref_change_registrar_.Add(
+ prefs::kWebKitDefaultFontSize,
+ base::Bind(&NewTabUI::OnDefaultFontSizeChanged, base::Unretained(this)));
}
NewTabUI::~NewTabUI() {}
@@ -77,6 +81,10 @@ void NewTabUI::OnShowBookmarkBarChanged() {
attached);
}
+void NewTabUI::OnDefaultFontSizeChanged() {
+ web_ui()->CallJavascriptFunctionUnsafe("ntp.defaultFontSizeChanged");
+}
+
// static
void NewTabUI::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698