~osomon/oxide/override-touchUngrabEvent

« back to all changes in this revision

Viewing changes to shared/browser/oxide_form_factor_detection_linux.cc

  • Committer: Chris Coulson
  • Date: 2016-01-08 21:31:20 UTC
  • Revision ID: chris.coulson@canonical.com-20160108213120-9v54434yvfmsd7lz
Be a bit more intelligent when detecting whether the hybris camera compatibility layer is available, or whether we're running on the Android EGL stack

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "shared/common/oxide_form_factor.h"
25
25
 
26
 
#include "oxide_android_properties.h"
 
26
#if defined(ENABLE_HYBRIS)
 
27
#include "oxide_hybris_utils.h"
 
28
#endif
27
29
 
28
30
namespace oxide {
29
31
 
30
32
FormFactor DetectFormFactorHintImpl(const gfx::Size& primary_screen_size_dip) {
31
 
  if (AndroidProperties::GetInstance()->Available()) {
 
33
#if defined(ENABLE_HYBRIS)
 
34
  if (HybrisUtils::HasDeviceProperties()) {
32
35
    // Ubuntu on phones and tablets currently uses an Android kernel and EGL
33
36
    // stack. If we detect these, assume we are a phone or tablet. The screen
34
37
    // size check here is basically the same as Chrome for Android, where
40
43
 
41
44
    return FORM_FACTOR_PHONE;
42
45
  }
 
46
#endif
43
47
 
44
48
  // If this is not an Ubuntu phone or tablet, assume desktop linux for now.
45
49
  // We could be cleverer here, eg, using /sys/class/dmi/id/chassis_type