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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 660349: First cut at custom user style sheets. (Closed)
Patch Set: compile Created 10 years, 9 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
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 891249a79bcd04b57893b02161b5a0de9f16ab66..28153912df2dde7077b42a66dcc2aacfb976d0a0 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -319,6 +319,9 @@ TabContents::TabContents(Profile* profile,
NotificationService::AllSources());
#endif
+ registrar_.Add(this, NotificationType::USER_STYLE_SHEET_UPDATED,
+ NotificationService::AllSources());
+
// Register for notifications about content setting changes.
registrar_.Add(this, NotificationType::CONTENT_SETTINGS_CHANGED,
NotificationService::AllSources());
@@ -2561,9 +2564,9 @@ GURL TabContents::GetAlternateErrorPageURL() const {
}
WebPreferences TabContents::GetWebkitPrefs() {
- PrefService* prefs = render_view_host()->process()->profile()->GetPrefs();
+ Profile* profile = render_view_host()->process()->profile();
bool is_dom_ui = false;
- return RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, is_dom_ui);
+ return RenderViewHostDelegateHelper::GetWebkitPrefs(profile, is_dom_ui);
}
void TabContents::OnIgnoredUIEvent() {
@@ -2779,6 +2782,10 @@ void TabContents::Observe(NotificationType type,
}
#endif
+ case NotificationType::USER_STYLE_SHEET_UPDATED:
+ UpdateWebPreferences();
+ break;
+
case NotificationType::CONTENT_SETTINGS_CHANGED: {
Details<HostContentSettingsMap::ContentSettingsDetails>
settings_details(details);
« no previous file with comments | « chrome/browser/tab_contents/render_view_host_delegate_helper.cc ('k') | chrome/browser/user_style_sheet_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698