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/chromeos/system/timezone_settings.h" | 5 #include "chrome/browser/chromeos/system/timezone_settings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/chromeos/chromeos_version.h" | 10 #include "base/chromeos/chromeos_version.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 return entry; | 345 return entry; |
346 if (entry->hasSameRules(timezone)) | 346 if (entry->hasSameRules(timezone)) |
347 known_timezone = entry; | 347 known_timezone = entry; |
348 } | 348 } |
349 | 349 |
350 // May return NULL if we did not find a matching timezone in our list. | 350 // May return NULL if we did not find a matching timezone in our list. |
351 return known_timezone; | 351 return known_timezone; |
352 } | 352 } |
353 | 353 |
354 void TimezoneSettingsBaseImpl::NotifyRenderers() { | 354 void TimezoneSettingsBaseImpl::NotifyRenderers() { |
355 content::RenderProcessHost::iterator process_iterator( | 355 content::RenderWidgetHost::List widgets = |
356 content::RenderProcessHost::AllHostsIterator()); | 356 content::RenderWidgetHost::GetRenderWidgetHosts(); |
357 for (; !process_iterator.IsAtEnd(); process_iterator.Advance()) { | 357 for (content::RenderWidgetHost::List::const_iterator it = widgets.begin(); |
jam
2013/06/12 19:59:59
ditto
nasko
2013/06/12 21:18:59
Done.
| |
358 content::RenderProcessHost* render_process_host = | 358 it != widgets.end(); ++it) { |
359 process_iterator.GetCurrentValue(); | 359 const content::RenderWidgetHost* widget = *it; |
360 content::RenderProcessHost::RenderWidgetHostsIterator widget_iterator( | 360 if (widget->IsRenderView()) { |
361 render_process_host->GetRenderWidgetHostsIterator()); | 361 content::RenderViewHost* view = content::RenderViewHost::From( |
362 for (; !widget_iterator.IsAtEnd(); widget_iterator.Advance()) { | 362 const_cast<content::RenderWidgetHost*>(widget)); |
363 const content::RenderWidgetHost* widget = | 363 view->NotifyTimezoneChange(); |
364 widget_iterator.GetCurrentValue(); | |
365 if (widget->IsRenderView()) { | |
366 content::RenderViewHost* view = content::RenderViewHost::From( | |
367 const_cast<content::RenderWidgetHost*>(widget)); | |
368 view->NotifyTimezoneChange(); | |
369 } | |
370 } | 364 } |
371 } | 365 } |
372 } | 366 } |
373 | 367 |
374 void TimezoneSettingsImpl::SetTimezone(const icu::TimeZone& timezone) { | 368 void TimezoneSettingsImpl::SetTimezone(const icu::TimeZone& timezone) { |
375 // Replace |timezone| by a known timezone with the same rules. If none exists | 369 // Replace |timezone| by a known timezone with the same rules. If none exists |
376 // go on with |timezone|. | 370 // go on with |timezone|. |
377 const icu::TimeZone* known_timezone = GetKnownTimezoneOrNull(timezone); | 371 const icu::TimeZone* known_timezone = GetKnownTimezoneOrNull(timezone); |
378 if (!known_timezone) | 372 if (!known_timezone) |
379 known_timezone = &timezone; | 373 known_timezone = &timezone; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 | 453 |
460 // static | 454 // static |
461 string16 TimezoneSettings::GetTimezoneID(const icu::TimeZone& timezone) { | 455 string16 TimezoneSettings::GetTimezoneID(const icu::TimeZone& timezone) { |
462 icu::UnicodeString id; | 456 icu::UnicodeString id; |
463 timezone.getID(id); | 457 timezone.getID(id); |
464 return string16(id.getBuffer(), id.length()); | 458 return string16(id.getBuffer(), id.length()); |
465 } | 459 } |
466 | 460 |
467 } // namespace system | 461 } // namespace system |
468 } // namespace chromeos | 462 } // namespace chromeos |
OLD | NEW |