DeviceUtils.java revision 116680a4aac90f2aa7413d9095a592090648e557
1// Copyright 2012 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 5package org.chromium.content.browser; 6 7import android.content.Context; 8 9import org.chromium.base.CommandLine; 10import org.chromium.content.common.ContentSwitches; 11import org.chromium.ui.base.DeviceFormFactor; 12 13/** 14 * A utility class that has helper methods for device configuration. 15 */ 16public class DeviceUtils { 17 18 /** 19 * Appends the switch specifying which user agent should be used for this device. 20 * @param context The context for the caller activity. 21 */ 22 public static void addDeviceSpecificUserAgentSwitch(Context context) { 23 if (!DeviceFormFactor.isTablet(context)) { 24 CommandLine.getInstance().appendSwitch(ContentSwitches.USE_MOBILE_UA); 25 } 26 } 27} 28