device_form_factor_android.cc 557 B

123456789101112131415161718
  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
  3. // found in the LICENSE file.
  4. #include "ui/base/device_form_factor.h"
  5. #include "base/android/jni_android.h"
  6. #include "ui/base/ui_base_jni_headers/DeviceFormFactor_jni.h"
  7. namespace ui {
  8. DeviceFormFactor GetDeviceFormFactor() {
  9. bool is_tablet =
  10. Java_DeviceFormFactor_isTablet(base::android::AttachCurrentThread());
  11. return is_tablet ? DEVICE_FORM_FACTOR_TABLET : DEVICE_FORM_FACTOR_PHONE;
  12. }
  13. } // namespace ui