Skip to content

Commit

Permalink
Remove usage of FOR_EACH_OBSERVER macro in apps/
Browse files Browse the repository at this point in the history
Observer lists now support range-based for loops.

BUG=655021

Review-Url: https://codereview.chromium.org/2422543002
Cr-Commit-Position: refs/heads/master@{#425802}
  • Loading branch information
ericwilligers authored and Commit bot committed Oct 17, 2016
1 parent ce4bc51 commit 01080f9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions apps/app_lifetime_monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,28 @@ bool AppLifetimeMonitor::HasOtherVisibleAppWindows(
}

void AppLifetimeMonitor::NotifyAppStart(const std::string& app_id) {
FOR_EACH_OBSERVER(Observer, observers_, OnAppStart(profile_, app_id));
for (auto& observer : observers_)
observer.OnAppStart(profile_, app_id);
}

void AppLifetimeMonitor::NotifyAppActivated(const std::string& app_id) {
FOR_EACH_OBSERVER(Observer, observers_, OnAppActivated(profile_, app_id));
for (auto& observer : observers_)
observer.OnAppActivated(profile_, app_id);
}

void AppLifetimeMonitor::NotifyAppDeactivated(const std::string& app_id) {
FOR_EACH_OBSERVER(Observer, observers_, OnAppDeactivated(profile_, app_id));
for (auto& observer : observers_)
observer.OnAppDeactivated(profile_, app_id);
}

void AppLifetimeMonitor::NotifyAppStop(const std::string& app_id) {
FOR_EACH_OBSERVER(Observer, observers_, OnAppStop(profile_, app_id));
for (auto& observer : observers_)
observer.OnAppStop(profile_, app_id);
}

void AppLifetimeMonitor::NotifyChromeTerminating() {
FOR_EACH_OBSERVER(Observer, observers_, OnChromeTerminating());
for (auto& observer : observers_)
observer.OnChromeTerminating();
}

} // namespace apps

0 comments on commit 01080f9

Please sign in to comment.