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

Unified Diff: content/browser/renderer_host/text_input_manager.cc

Issue 2418143004: Reduce FOR_EACH_OBSERVER usage in content/browser/renderer_host (Closed)
Patch Set: rebase Created 4 years, 2 months 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
Index: content/browser/renderer_host/text_input_manager.cc
diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc
index 3c15100c4446230bd9cdf8a6d281c18e373776a9..3b75d36aca95cf2e63c1f29109057b2f2b796ec4 100644
--- a/content/browser/renderer_host/text_input_manager.cc
+++ b/content/browser/renderer_host/text_input_manager.cc
@@ -140,8 +140,8 @@ void TextInputManager::UpdateTextInputState(
void TextInputManager::ImeCancelComposition(RenderWidgetHostViewBase* view) {
DCHECK(IsRegistered(view));
- FOR_EACH_OBSERVER(Observer, observer_list_,
- OnImeCancelComposition(this, view));
+ for (auto& observer : observer_list_)
+ observer.OnImeCancelComposition(this, view);
}
void TextInputManager::SelectionBoundsChanged(
@@ -203,8 +203,8 @@ void TextInputManager::SelectionBoundsChanged(
selection_region_map_[view].first_selection_rect.set_size(
params.anchor_rect.size());
- FOR_EACH_OBSERVER(Observer, observer_list_,
- OnSelectionBoundsChanged(this, view));
+ for (auto& observer : observer_list_)
+ observer.OnSelectionBoundsChanged(this, view);
}
// TODO(ekaramad): We use |range| only on Mac OS; but we still track its value
@@ -227,8 +227,8 @@ void TextInputManager::ImeCompositionRangeChanged(
composition_range_info_map_[view].range.set_start(range.start());
composition_range_info_map_[view].range.set_end(range.end());
- FOR_EACH_OBSERVER(Observer, observer_list_,
- OnImeCompositionRangeChanged(this, view));
+ for (auto& observer : observer_list_)
+ observer.OnImeCompositionRangeChanged(this, view);
}
void TextInputManager::SelectionChanged(RenderWidgetHostViewBase* view,
@@ -242,8 +242,8 @@ void TextInputManager::SelectionChanged(RenderWidgetHostViewBase* view,
text_selection_map_[view].range.set_start(range.start());
text_selection_map_[view].range.set_end(range.end());
- FOR_EACH_OBSERVER(Observer, observer_list_,
- OnTextSelectionChanged(this, view));
+ for (auto& observer : observer_list_)
+ observer.OnTextSelectionChanged(this, view);
}
void TextInputManager::Register(RenderWidgetHostViewBase* view) {
@@ -299,9 +299,8 @@ ui::TextInputType TextInputManager::GetTextInputTypeForViewForTesting(
void TextInputManager::NotifyObserversAboutInputStateUpdate(
RenderWidgetHostViewBase* updated_view,
bool did_update_state) {
- FOR_EACH_OBSERVER(
- Observer, observer_list_,
- OnUpdateTextInputStateCalled(this, updated_view, did_update_state));
+ for (auto& observer : observer_list_)
+ observer.OnUpdateTextInputStateCalled(this, updated_view, did_update_state);
}
TextInputManager::SelectionRegion::SelectionRegion() {}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_base.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698