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 #ifndef CHROMECAST_ANDROID_CHROMECAST_CONFIG_ANDROID_H_ 6 #define CHROMECAST_ANDROID_CHROMECAST_CONFIG_ANDROID_H_ 7 8 #include <jni.h> 9 10 #include "base/callback.h" 11 #include "base/lazy_instance.h" 12 #include "base/macros.h" 13 14 namespace chromecast { 15 namespace android { 16 17 class ChromecastConfigAndroid { 18 public: 19 static ChromecastConfigAndroid* GetInstance(); 20 21 // Registers a handler to be notified when SendUsageStats is changed. 22 void SetSendUsageStatsChangedCallback( 23 const base::Callback<void(bool)>& callback); 24 25 const base::Callback<void(bool)>& send_usage_stats_changed_callback() const { 26 return send_usage_stats_changed_callback_; 27 } 28 29 private: 30 friend struct base::DefaultLazyInstanceTraits<ChromecastConfigAndroid>; 31 32 ChromecastConfigAndroid(); 33 ~ChromecastConfigAndroid(); 34 35 base::Callback<void(bool)> send_usage_stats_changed_callback_; 36 37 DISALLOW_COPY_AND_ASSIGN(ChromecastConfigAndroid); 38 }; 39 40 } // namespace android 41 } // namespace chromecast 42 43 #endif // CHROMECAST_ANDROID_CHROMECAST_CONFIG_ANDROID_H_ 44