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

Side by Side Diff: content/browser/time_zone_monitor_android.cc

Issue 251613002: Broadcast NotifyTimezoneChange to all RenderProcessHosts when the system time zone changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/time_zone_monitor_android.h"
6
7 #include "base/android/jni_android.h"
8 #include "jni/TimeZoneMonitor_jni.h"
9
10 namespace content {
11
12 TimeZoneMonitorAndroid::TimeZoneMonitorAndroid() : TimeZoneMonitor() {
13 JNIEnv* env = base::android::AttachCurrentThread();
14 impl_.Reset(Java_TimeZoneMonitor_getInstance(
bulach 2014/04/29 08:33:44 how about making getInstance() call start() if nee
Mark Mentovai 2014/04/29 16:01:05 bulach wrote:
15 env, base::android::GetApplicationContext()));
16 Java_TimeZoneMonitor_start(
17 env, impl_.obj(), reinterpret_cast<intptr_t>(this));
18 }
19
20 TimeZoneMonitorAndroid::~TimeZoneMonitorAndroid() {
21 Java_TimeZoneMonitor_stop(base::android::AttachCurrentThread(), impl_.obj());
22 }
23
24 // static
25 bool TimeZoneMonitorAndroid::Register(JNIEnv* env) {
26 return RegisterNativesImpl(env);
27 }
28
29 void TimeZoneMonitorAndroid::TimeZoneChangedFromJava(JNIEnv* env,
30 jobject caller) {
31 NotifyRenderers();
32 }
33
34 // static
35 scoped_ptr<TimeZoneMonitor> TimeZoneMonitor::Create() {
36 return scoped_ptr<TimeZoneMonitor>(new TimeZoneMonitorAndroid());
37 }
38
39 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698