OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/base/device_form_factor_android.h" | 5 #include "ui/base/device_form_factor.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 "jni/DeviceFormFactor_jni.h" | 9 #include "jni/DeviceFormFactor_jni.h" |
10 | 10 |
11 namespace ui { | 11 namespace ui { |
12 | 12 |
13 DeviceFormFactor GetDeviceFormFactor() { | 13 DeviceFormFactor GetDeviceFormFactor() { |
14 bool is_tablet = Java_DeviceFormFactor_isTablet( | 14 bool is_tablet = Java_DeviceFormFactor_isTablet( |
15 base::android::AttachCurrentThread(), | 15 base::android::AttachCurrentThread(), |
16 base::android::GetApplicationContext()); | 16 base::android::GetApplicationContext()); |
17 return is_tablet ? DEVICE_FORM_FACTOR_TABLET : DEVICE_FORM_FACTOR_PHONE; | 17 return is_tablet ? DEVICE_FORM_FACTOR_TABLET : DEVICE_FORM_FACTOR_PHONE; |
18 } | 18 } |
19 | 19 |
20 bool RegisterDeviceFormFactorAndroid(JNIEnv* env) { | |
21 return RegisterNativesImpl(env); | |
22 } | |
23 | |
24 } // namespace ui | 20 } // namespace ui |
OLD | NEW |