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

Side by Side Diff: chromecast/base/android/system_time_change_notifier_android.cc

Issue 2807263002: Android: Remove GetApplicationContext for cast (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « chromecast/app/android/crash_handler.cc ('k') | chromecast/base/chromecast_config_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chromecast/base/android/system_time_change_notifier_android.h" 5 #include "chromecast/base/android/system_time_change_notifier_android.h"
6 6
7 #include "base/android/context_utils.h"
8 #include "jni/SystemTimeChangeNotifierAndroid_jni.h" 7 #include "jni/SystemTimeChangeNotifierAndroid_jni.h"
9 8
10 using base::android::JavaParamRef; 9 using base::android::JavaParamRef;
11 10
12 namespace chromecast { 11 namespace chromecast {
13 12
14 // static 13 // static
15 bool SystemTimeChangeNotifierAndroid::RegisterJni(JNIEnv* env) { 14 bool SystemTimeChangeNotifierAndroid::RegisterJni(JNIEnv* env) {
16 return RegisterNativesImpl(env); 15 return RegisterNativesImpl(env);
17 } 16 }
18 17
19 SystemTimeChangeNotifierAndroid::SystemTimeChangeNotifierAndroid() { 18 SystemTimeChangeNotifierAndroid::SystemTimeChangeNotifierAndroid() {
20 } 19 }
21 20
22 SystemTimeChangeNotifierAndroid::~SystemTimeChangeNotifierAndroid() { 21 SystemTimeChangeNotifierAndroid::~SystemTimeChangeNotifierAndroid() {
23 } 22 }
24 23
25 void SystemTimeChangeNotifierAndroid::Initialize() { 24 void SystemTimeChangeNotifierAndroid::Initialize() {
26 JNIEnv* env = base::android::AttachCurrentThread(); 25 JNIEnv* env = base::android::AttachCurrentThread();
27 java_notifier_.Reset(Java_SystemTimeChangeNotifierAndroid_create( 26 java_notifier_.Reset(Java_SystemTimeChangeNotifierAndroid_create(env));
28 env, base::android::GetApplicationContext()));
29 Java_SystemTimeChangeNotifierAndroid_initializeFromNative( 27 Java_SystemTimeChangeNotifierAndroid_initializeFromNative(
30 env, java_notifier_, reinterpret_cast<jlong>(this)); 28 env, java_notifier_, reinterpret_cast<jlong>(this));
31 } 29 }
32 30
33 void SystemTimeChangeNotifierAndroid::Finalize() { 31 void SystemTimeChangeNotifierAndroid::Finalize() {
34 JNIEnv* env = base::android::AttachCurrentThread(); 32 JNIEnv* env = base::android::AttachCurrentThread();
35 Java_SystemTimeChangeNotifierAndroid_finalizeFromNative(env, java_notifier_); 33 Java_SystemTimeChangeNotifierAndroid_finalizeFromNative(env, java_notifier_);
36 } 34 }
37 35
38 void SystemTimeChangeNotifierAndroid::OnTimeChanged( 36 void SystemTimeChangeNotifierAndroid::OnTimeChanged(
39 JNIEnv* env, 37 JNIEnv* env,
40 const JavaParamRef<jobject>& jobj) { 38 const JavaParamRef<jobject>& jobj) {
41 NotifySystemTimeChanged(); 39 NotifySystemTimeChanged();
42 } 40 }
43 41
44 } // namespace chromecast 42 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/app/android/crash_handler.cc ('k') | chromecast/base/chromecast_config_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698