| 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 } | 607 } |
| 608 break; | 608 break; |
| 609 } | 609 } |
| 610 default: | 610 default: |
| 611 NOTREACHED(); | 611 NOTREACHED(); |
| 612 } | 612 } |
| 613 } | 613 } |
| 614 | 614 |
| 615 void PrefsTabHelper::UpdateWebPreferences() { | 615 void PrefsTabHelper::UpdateWebPreferences() { |
| 616 content::RenderViewHostDelegate* rvhd = | 616 content::RenderViewHostDelegate* rvhd = |
| 617 web_contents()->GetRenderViewHost()->delegate(); | 617 web_contents()->GetRenderViewHost()->GetDelegate(); |
| 618 WebPreferences prefs = rvhd->GetWebkitPrefs(); | 618 WebPreferences prefs = rvhd->GetWebkitPrefs(); |
| 619 prefs.javascript_enabled = | 619 prefs.javascript_enabled = |
| 620 per_tab_prefs_->GetBoolean(prefs::kWebKitJavascriptEnabled); | 620 per_tab_prefs_->GetBoolean(prefs::kWebKitJavascriptEnabled); |
| 621 prefs.javascript_can_open_windows_automatically = | 621 prefs.javascript_can_open_windows_automatically = |
| 622 per_tab_prefs_->GetBoolean( | 622 per_tab_prefs_->GetBoolean( |
| 623 prefs::kWebKitJavascriptCanOpenWindowsAutomatically); | 623 prefs::kWebKitJavascriptCanOpenWindowsAutomatically); |
| 624 prefs.loads_images_automatically = | 624 prefs.loads_images_automatically = |
| 625 per_tab_prefs_->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); | 625 per_tab_prefs_->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); |
| 626 prefs.images_enabled = | 626 prefs.images_enabled = |
| 627 per_tab_prefs_->GetBoolean(prefs::kWebKitImagesEnabled); | 627 per_tab_prefs_->GetBoolean(prefs::kWebKitImagesEnabled); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 657 | 657 |
| 658 void PrefsTabHelper::UpdateRendererPreferences() { | 658 void PrefsTabHelper::UpdateRendererPreferences() { |
| 659 renderer_preferences_util::UpdateFromSystemSettings( | 659 renderer_preferences_util::UpdateFromSystemSettings( |
| 660 web_contents()->GetMutableRendererPrefs(), GetProfile()); | 660 web_contents()->GetMutableRendererPrefs(), GetProfile()); |
| 661 web_contents()->GetRenderViewHost()->SyncRendererPrefs(); | 661 web_contents()->GetRenderViewHost()->SyncRendererPrefs(); |
| 662 } | 662 } |
| 663 | 663 |
| 664 Profile* PrefsTabHelper::GetProfile() { | 664 Profile* PrefsTabHelper::GetProfile() { |
| 665 return Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 665 return Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 666 } | 666 } |
| OLD | NEW |