| Index: content/browser/time_zone_monitor.cc
|
| diff --git a/content/browser/time_zone_monitor.cc b/content/browser/time_zone_monitor.cc
|
| index a9a5a9b6c53689695468bb91294d934281e89c67..858a0e4d8d8e80ff0188b9a1fe4ed8bddda13dc3 100644
|
| --- a/content/browser/time_zone_monitor.cc
|
| +++ b/content/browser/time_zone_monitor.cc
|
| @@ -7,7 +7,6 @@
|
| #include "base/logging.h"
|
| #include "build/build_config.h"
|
| #include "content/public/browser/browser_thread.h"
|
| -#include "content/public/browser/render_process_host.h"
|
| #include "third_party/icu/source/common/unicode/unistr.h"
|
| #include "third_party/icu/source/i18n/unicode/timezone.h"
|
|
|
| @@ -21,7 +20,11 @@ TimeZoneMonitor::~TimeZoneMonitor() {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| }
|
|
|
| -void TimeZoneMonitor::NotifyRenderers() {
|
| +void TimeZoneMonitor::Bind(device::mojom::TimeZoneMonitorRequest request) {
|
| + bindings_.AddBinding(this, std::move(request));
|
| +}
|
| +
|
| +void TimeZoneMonitor::NotifyClients() {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| #if defined(OS_CHROMEOS)
|
| // On CrOS, ICU's default tz is already set to a new zone. No
|
| @@ -45,12 +48,16 @@ void TimeZoneMonitor::NotifyRenderers() {
|
| std::string zone_id_str;
|
| new_zone->getID(zone_id).toUTF8String(zone_id_str);
|
| VLOG(1) << "timezone reset to " << zone_id_str;
|
| - for (RenderProcessHost::iterator iterator =
|
| - RenderProcessHost::AllHostsIterator();
|
| - !iterator.IsAtEnd();
|
| - iterator.Advance()) {
|
| - iterator.GetCurrentValue()->NotifyTimezoneChange(zone_id_str);
|
| - }
|
| +
|
| + clients_.ForAllPtrs(
|
| + [&zone_id_str](device::mojom::TimeZoneMonitorClient* client) {
|
| + client->OnTimeZoneChange(zone_id_str);
|
| + });
|
| +}
|
| +
|
| +void TimeZoneMonitor::AddClient(
|
| + device::mojom::TimeZoneMonitorClientPtr client) {
|
| + clients_.AddPtr(std::move(client));
|
| }
|
|
|
| } // namespace content
|
|
|