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

Unified Diff: chrome/browser/ui/prefs/prefs_tab_helper.cc

Issue 9030010: Move most of the remaining users of WebContentsObserver::tab_contents() to use web_contents(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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/prefs/prefs_tab_helper.h ('k') | chrome/browser/ui/sad_tab_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/prefs/prefs_tab_helper.cc
===================================================================
--- chrome/browser/ui/prefs/prefs_tab_helper.cc (revision 115777)
+++ chrome/browser/ui/prefs/prefs_tab_helper.cc (working copy)
@@ -16,9 +16,10 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/tab_contents/tab_contents.h"
+#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/web_contents.h"
#include "grit/locale_settings.h"
#include "grit/platform_locale_settings.h"
#include "webkit/glue/webpreferences.h"
@@ -212,9 +213,8 @@
} // namespace
-PrefsTabHelper::PrefsTabHelper(TabContents* contents)
- : content::WebContentsObserver(contents),
- contents_(contents) {
+PrefsTabHelper::PrefsTabHelper(WebContents* contents)
+ : content::WebContentsObserver(contents) {
PrefService* prefs = GetProfile()->GetPrefs();
pref_change_registrar_.Init(prefs);
if (prefs) {
@@ -244,7 +244,7 @@
}
renderer_preferences_util::UpdateFromSystemSettings(
- tab_contents()->GetMutableRendererPrefs(), GetProfile());
+ web_contents()->GetMutableRendererPrefs(), GetProfile());
registrar_.Add(this, chrome::NOTIFICATION_USER_STYLE_SHEET_UPDATED,
content::NotificationService::AllSources());
@@ -426,19 +426,20 @@
}
void PrefsTabHelper::UpdateWebPreferences() {
- RenderViewHostDelegate* rvhd = tab_contents();
+ RenderViewHostDelegate* rvhd =
+ web_contents()->GetRenderViewHost()->delegate();
WebPreferences prefs = rvhd->GetWebkitPrefs();
prefs.javascript_enabled =
per_tab_prefs_->GetBoolean(prefs::kWebKitJavascriptEnabled);
- tab_contents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs);
+ web_contents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs);
}
void PrefsTabHelper::UpdateRendererPreferences() {
renderer_preferences_util::UpdateFromSystemSettings(
- tab_contents()->GetMutableRendererPrefs(), GetProfile());
- tab_contents()->GetRenderViewHost()->SyncRendererPrefs();
+ web_contents()->GetMutableRendererPrefs(), GetProfile());
+ web_contents()->GetRenderViewHost()->SyncRendererPrefs();
}
Profile* PrefsTabHelper::GetProfile() {
- return Profile::FromBrowserContext(contents_->GetBrowserContext());
+ return Profile::FromBrowserContext(web_contents()->GetBrowserContext());
}
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.h ('k') | chrome/browser/ui/sad_tab_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698