| OLD | NEW |
| 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/cast_sys_info_android.h" | 5 #include "chromecast/base/cast_sys_info_android.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 12 #include "chromecast/base/cast_sys_info_util.h" | 13 #include "chromecast/base/cast_sys_info_util.h" |
| 13 #include "chromecast/base/version.h" | 14 #include "chromecast/base/version.h" |
| 14 #include "jni/CastSysInfoAndroid_jni.h" | 15 #include "jni/CastSysInfoAndroid_jni.h" |
| 15 | 16 |
| 16 namespace chromecast { | 17 namespace chromecast { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 const char kBuildTypeUser[] = "user"; | 20 const char kBuildTypeUser[] = "user"; |
| 20 } // namespace | 21 } // namespace |
| 21 | 22 |
| 22 // static | 23 // static |
| 23 bool CastSysInfoAndroid::RegisterJni(JNIEnv* env) { | 24 bool CastSysInfoAndroid::RegisterJni(JNIEnv* env) { |
| 24 return RegisterNativesImpl(env); | 25 return RegisterNativesImpl(env); |
| 25 } | 26 } |
| 26 | 27 |
| 27 // static | 28 // static |
| 28 scoped_ptr<CastSysInfo> CreateSysInfo() { | 29 std::unique_ptr<CastSysInfo> CreateSysInfo() { |
| 29 return make_scoped_ptr(new CastSysInfoAndroid()); | 30 return base::WrapUnique(new CastSysInfoAndroid()); |
| 30 } | 31 } |
| 31 | 32 |
| 32 CastSysInfoAndroid::CastSysInfoAndroid() | 33 CastSysInfoAndroid::CastSysInfoAndroid() |
| 33 : build_info_(base::android::BuildInfo::GetInstance()) { | 34 : build_info_(base::android::BuildInfo::GetInstance()) { |
| 34 } | 35 } |
| 35 | 36 |
| 36 CastSysInfoAndroid::~CastSysInfoAndroid() { | 37 CastSysInfoAndroid::~CastSysInfoAndroid() { |
| 37 } | 38 } |
| 38 | 39 |
| 39 CastSysInfo::BuildType CastSysInfoAndroid::GetBuildType() { | 40 CastSysInfo::BuildType CastSysInfoAndroid::GetBuildType() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 NOTREACHED() << "GL information shouldn't be requested on Android."; | 119 NOTREACHED() << "GL information shouldn't be requested on Android."; |
| 119 return ""; | 120 return ""; |
| 120 } | 121 } |
| 121 | 122 |
| 122 std::string CastSysInfoAndroid::GetGlVersion() { | 123 std::string CastSysInfoAndroid::GetGlVersion() { |
| 123 NOTREACHED() << "GL information shouldn't be requested on Android."; | 124 NOTREACHED() << "GL information shouldn't be requested on Android."; |
| 124 return ""; | 125 return ""; |
| 125 } | 126 } |
| 126 | 127 |
| 127 } // namespace chromecast | 128 } // namespace chromecast |
| OLD | NEW |