| 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 "chrome/browser/ui/prefs/prefs_tab_helper.h" | 5 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 PrefService::SYNCABLE_PREF); | 562 PrefService::SYNCABLE_PREF); |
| 563 prefs->RegisterLocalizedStringPref(prefs::kStaticEncodings, | 563 prefs->RegisterLocalizedStringPref(prefs::kStaticEncodings, |
| 564 IDS_STATIC_ENCODING_LIST, | 564 IDS_STATIC_ENCODING_LIST, |
| 565 PrefService::UNSYNCABLE_PREF); | 565 PrefService::UNSYNCABLE_PREF); |
| 566 prefs->RegisterStringPref(prefs::kRecentlySelectedEncoding, | 566 prefs->RegisterStringPref(prefs::kRecentlySelectedEncoding, |
| 567 "", | 567 "", |
| 568 PrefService::UNSYNCABLE_PREF); | 568 PrefService::UNSYNCABLE_PREF); |
| 569 MigratePreferences(prefs); | 569 MigratePreferences(prefs); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void PrefsTabHelper::RenderViewCreated(RenderViewHost* render_view_host) { | 572 void PrefsTabHelper::RenderViewCreated( |
| 573 content::RenderViewHost* render_view_host) { |
| 573 UpdateWebPreferences(); | 574 UpdateWebPreferences(); |
| 574 } | 575 } |
| 575 | 576 |
| 576 void PrefsTabHelper::WebContentsDestroyed(WebContents* tab) { | 577 void PrefsTabHelper::WebContentsDestroyed(WebContents* tab) { |
| 577 per_tab_pref_change_registrar_.RemoveAll(); | 578 per_tab_pref_change_registrar_.RemoveAll(); |
| 578 } | 579 } |
| 579 | 580 |
| 580 void PrefsTabHelper::Observe(int type, | 581 void PrefsTabHelper::Observe(int type, |
| 581 const content::NotificationSource& source, | 582 const content::NotificationSource& source, |
| 582 const content::NotificationDetails& details) { | 583 const content::NotificationDetails& details) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 | 658 |
| 658 void PrefsTabHelper::UpdateRendererPreferences() { | 659 void PrefsTabHelper::UpdateRendererPreferences() { |
| 659 renderer_preferences_util::UpdateFromSystemSettings( | 660 renderer_preferences_util::UpdateFromSystemSettings( |
| 660 web_contents()->GetMutableRendererPrefs(), GetProfile()); | 661 web_contents()->GetMutableRendererPrefs(), GetProfile()); |
| 661 web_contents()->GetRenderViewHost()->SyncRendererPrefs(); | 662 web_contents()->GetRenderViewHost()->SyncRendererPrefs(); |
| 662 } | 663 } |
| 663 | 664 |
| 664 Profile* PrefsTabHelper::GetProfile() { | 665 Profile* PrefsTabHelper::GetProfile() { |
| 665 return Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 666 return Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 666 } | 667 } |
| OLD | NEW |