| 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 "chromecast/base/chromecast_config_android.h" | 5 #include "chromecast/base/chromecast_config_android.h" |
| 6 | 6 |
| 7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "jni/ChromecastConfigAndroid_jni.h" | 10 #include "jni/ChromecastConfigAndroid_jni.h" |
| 11 | 11 |
| 12 using base::android::JavaParamRef; | 12 using base::android::JavaParamRef; |
| 13 | 13 |
| 14 namespace chromecast { | 14 namespace chromecast { |
| 15 namespace android { | 15 namespace android { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 base::LazyInstance<ChromecastConfigAndroid> g_instance = | 18 base::LazyInstance<ChromecastConfigAndroid>::DestructorAtExit g_instance = |
| 19 LAZY_INSTANCE_INITIALIZER; | 19 LAZY_INSTANCE_INITIALIZER; |
| 20 } // namespace | 20 } // namespace |
| 21 | 21 |
| 22 // static | 22 // static |
| 23 ChromecastConfigAndroid* ChromecastConfigAndroid::GetInstance() { | 23 ChromecastConfigAndroid* ChromecastConfigAndroid::GetInstance() { |
| 24 return g_instance.Pointer(); | 24 return g_instance.Pointer(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 bool ChromecastConfigAndroid::RegisterJni(JNIEnv* env) { | 28 bool ChromecastConfigAndroid::RegisterJni(JNIEnv* env) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 52 // Called from Java. | 52 // Called from Java. |
| 53 void SetSendUsageStatsEnabled(JNIEnv* env, | 53 void SetSendUsageStatsEnabled(JNIEnv* env, |
| 54 const JavaParamRef<jclass>& caller, | 54 const JavaParamRef<jclass>& caller, |
| 55 jboolean enabled) { | 55 jboolean enabled) { |
| 56 ChromecastConfigAndroid::GetInstance()-> | 56 ChromecastConfigAndroid::GetInstance()-> |
| 57 send_usage_stats_changed_callback().Run(enabled); | 57 send_usage_stats_changed_callback().Run(enabled); |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace android | 60 } // namespace android |
| 61 } // namespace chromecast | 61 } // namespace chromecast |
| OLD | NEW |