OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/dom_distiller/core/distilled_page_prefs.h" | 5 #include "components/dom_distiller/core/distilled_page_prefs.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void DistilledPagePrefs::AddObserver(Observer* obs) { | 108 void DistilledPagePrefs::AddObserver(Observer* obs) { |
109 observers_.AddObserver(obs); | 109 observers_.AddObserver(obs); |
110 } | 110 } |
111 | 111 |
112 void DistilledPagePrefs::RemoveObserver(Observer* obs) { | 112 void DistilledPagePrefs::RemoveObserver(Observer* obs) { |
113 observers_.RemoveObserver(obs); | 113 observers_.RemoveObserver(obs); |
114 } | 114 } |
115 | 115 |
116 void DistilledPagePrefs::NotifyOnChangeFontFamily( | 116 void DistilledPagePrefs::NotifyOnChangeFontFamily( |
117 DistilledPagePrefs::FontFamily new_font_family) { | 117 DistilledPagePrefs::FontFamily new_font_family) { |
118 FOR_EACH_OBSERVER(Observer, observers_, OnChangeFontFamily(new_font_family)); | 118 for (Observer& observer : observers_) |
| 119 observer.OnChangeFontFamily(new_font_family); |
119 } | 120 } |
120 | 121 |
121 void DistilledPagePrefs::NotifyOnChangeTheme( | 122 void DistilledPagePrefs::NotifyOnChangeTheme( |
122 DistilledPagePrefs::Theme new_theme) { | 123 DistilledPagePrefs::Theme new_theme) { |
123 FOR_EACH_OBSERVER(Observer, observers_, OnChangeTheme(new_theme)); | 124 for (Observer& observer : observers_) |
| 125 observer.OnChangeTheme(new_theme); |
124 } | 126 } |
125 | 127 |
126 void DistilledPagePrefs::NotifyOnChangeFontScaling( | 128 void DistilledPagePrefs::NotifyOnChangeFontScaling( |
127 float scaling) { | 129 float scaling) { |
128 FOR_EACH_OBSERVER(Observer, observers_, OnChangeFontScaling(scaling)); | 130 for (Observer& observer : observers_) |
| 131 observer.OnChangeFontScaling(scaling); |
129 } | 132 } |
130 | 133 |
131 } // namespace dom_distiller | 134 } // namespace dom_distiller |
OLD | NEW |