| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 return; | 667 return; |
| 668 } | 668 } |
| 669 } | 669 } |
| 670 } | 670 } |
| 671 | 671 |
| 672 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { | 672 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { |
| 673 // Use PostTask to dispatch the OnWebkitPreferencesChanged notification to | 673 // Use PostTask to dispatch the OnWebkitPreferencesChanged notification to |
| 674 // give other observers (particularly the FontFamilyCache) a chance to react | 674 // give other observers (particularly the FontFamilyCache) a chance to react |
| 675 // to the pref change. | 675 // to the pref change. |
| 676 base::ThreadTaskRunnerHandle::Get()->PostTask( | 676 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 677 FROM_HERE, base::Bind(&PrefsTabHelper::NotifyWebkitPreferencesChanged, | 677 FROM_HERE, base::BindOnce(&PrefsTabHelper::NotifyWebkitPreferencesChanged, |
| 678 weak_ptr_factory_.GetWeakPtr(), pref_name)); | 678 weak_ptr_factory_.GetWeakPtr(), pref_name)); |
| 679 } | 679 } |
| 680 | 680 |
| 681 void PrefsTabHelper::NotifyWebkitPreferencesChanged( | 681 void PrefsTabHelper::NotifyWebkitPreferencesChanged( |
| 682 const std::string& pref_name) { | 682 const std::string& pref_name) { |
| 683 #if !defined(OS_ANDROID) | 683 #if !defined(OS_ANDROID) |
| 684 OnFontFamilyPrefChanged(pref_name); | 684 OnFontFamilyPrefChanged(pref_name); |
| 685 #endif | 685 #endif |
| 686 | 686 |
| 687 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); | 687 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); |
| 688 } | 688 } |
| OLD | NEW |