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 "content/browser/time_zone_monitor.h" | 5 #include "content/browser/time_zone_monitor.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace { | 25 namespace { |
26 class TimeZoneMonitorLinuxImpl; | 26 class TimeZoneMonitorLinuxImpl; |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 class TimeZoneMonitorLinux : public TimeZoneMonitor { | 29 class TimeZoneMonitorLinux : public TimeZoneMonitor { |
30 public: | 30 public: |
31 TimeZoneMonitorLinux(); | 31 TimeZoneMonitorLinux(); |
32 ~TimeZoneMonitorLinux() override; | 32 ~TimeZoneMonitorLinux() override; |
33 | 33 |
34 void NotifyRenderersFromImpl() { | 34 void NotifyClientsFromImpl() { NotifyClients(); } |
35 NotifyRenderers(); | |
36 } | |
37 | 35 |
38 private: | 36 private: |
39 scoped_refptr<TimeZoneMonitorLinuxImpl> impl_; | 37 scoped_refptr<TimeZoneMonitorLinuxImpl> impl_; |
40 | 38 |
41 DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitorLinux); | 39 DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitorLinux); |
42 }; | 40 }; |
43 | 41 |
44 namespace { | 42 namespace { |
45 | 43 |
46 // FilePathWatcher needs to run on the FILE thread, but TimeZoneMonitor runs | 44 // FilePathWatcher needs to run on the FILE thread, but TimeZoneMonitor runs |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 BrowserThread::PostTask( | 110 BrowserThread::PostTask( |
113 BrowserThread::UI, | 111 BrowserThread::UI, |
114 FROM_HERE, | 112 FROM_HERE, |
115 base::Bind(&TimeZoneMonitorLinuxImpl::OnTimeZoneFileChangedOnUIThread, | 113 base::Bind(&TimeZoneMonitorLinuxImpl::OnTimeZoneFileChangedOnUIThread, |
116 this)); | 114 this)); |
117 } | 115 } |
118 | 116 |
119 void OnTimeZoneFileChangedOnUIThread() { | 117 void OnTimeZoneFileChangedOnUIThread() { |
120 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 118 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
121 if (owner_) { | 119 if (owner_) { |
122 owner_->NotifyRenderersFromImpl(); | 120 owner_->NotifyClientsFromImpl(); |
123 } | 121 } |
124 } | 122 } |
125 | 123 |
126 std::vector<base::FilePathWatcher*> file_path_watchers_; | 124 std::vector<base::FilePathWatcher*> file_path_watchers_; |
127 TimeZoneMonitorLinux* owner_; | 125 TimeZoneMonitorLinux* owner_; |
128 | 126 |
129 DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitorLinuxImpl); | 127 DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitorLinuxImpl); |
130 }; | 128 }; |
131 | 129 |
132 } // namespace | 130 } // namespace |
(...skipping 26 matching lines...) Expand all Loading... |
159 } | 157 } |
160 | 158 |
161 // static | 159 // static |
162 std::unique_ptr<TimeZoneMonitor> TimeZoneMonitor::Create() { | 160 std::unique_ptr<TimeZoneMonitor> TimeZoneMonitor::Create() { |
163 return std::unique_ptr<TimeZoneMonitor>(new TimeZoneMonitorLinux()); | 161 return std::unique_ptr<TimeZoneMonitor>(new TimeZoneMonitorLinux()); |
164 } | 162 } |
165 | 163 |
166 } // namespace content | 164 } // namespace content |
167 | 165 |
168 #endif // !OS_CHROMEOS | 166 #endif // !OS_CHROMEOS |
OLD | NEW |