Java Code Examples for org.chromium.chrome.browser.preferences.LocationSettings

The following examples show how to use org.chromium.chrome.browser.preferences.LocationSettings. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: delion   Source File: LocationCategory.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public boolean showPermissionBlockedMessage(Context context) {
    if (enabledForChrome(context) && enabledGlobally()) {
        return false;
    }

    // The only time we don't want to show location as blocked in system is when Chrome also
    // blocks Location by policy (because then turning it on in the system isn't going to
    // turn on location in Chrome).
    PrefServiceBridge prefs = PrefServiceBridge.getInstance();
    if (!LocationSettings.getInstance().isChromeLocationSettingEnabled()
            && !prefs.isAllowLocationUserModifiable()) {
        return false;
    }

    return true;
}
 
Example 2
Source Project: AndroidChromium   Source File: LocationCategory.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public boolean showPermissionBlockedMessage(Context context) {
    if (enabledForChrome(context) && enabledGlobally()) {
        return false;
    }

    // The only time we don't want to show location as blocked in system is when Chrome also
    // blocks Location by policy (because then turning it on in the system isn't going to
    // turn on location in Chrome).
    PrefServiceBridge prefs = PrefServiceBridge.getInstance();
    if (!LocationSettings.getInstance().isChromeLocationSettingEnabled()
            && !prefs.isAllowLocationUserModifiable()) {
        return false;
    }

    return true;
}
 
Example 3
Source Project: 365browser   Source File: LocationCategory.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public boolean showPermissionBlockedMessage(Context context) {
    if (enabledForChrome(context) && enabledGlobally()) {
        return false;
    }

    // The only time we don't want to show location as blocked in system is when Chrome also
    // blocks Location by policy (because then turning it on in the system isn't going to
    // turn on location in Chrome).
    PrefServiceBridge prefs = PrefServiceBridge.getInstance();
    if (!LocationSettings.getInstance().isChromeLocationSettingEnabled()
            && !prefs.isAllowLocationUserModifiable()) {
        return false;
    }

    return true;
}
 
Example 4
Source Project: delion   Source File: ChromeApplication.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns an instance of LocationSettings to be installed as a singleton.
 */
public LocationSettings createLocationSettings() {
    // Using an anonymous subclass as the constructor is protected.
    // This is done to deter instantiation of LocationSettings elsewhere without using the
    // getInstance() helper method.
    return new LocationSettings(this){};
}
 
Example 5
Source Project: AndroidChromium   Source File: ChromeApplication.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns an instance of LocationSettings to be installed as a singleton.
 */
public LocationSettings createLocationSettings() {
    // Using an anonymous subclass as the constructor is protected.
    // This is done to deter instantiation of LocationSettings elsewhere without using the
    // getInstance() helper method.
    return new LocationSettings(){};
}
 
Example 6
Source Project: 365browser   Source File: AppHooks.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns an instance of LocationSettings to be installed as a singleton.
 */
public LocationSettings createLocationSettings() {
    // Using an anonymous subclass as the constructor is protected.
    // This is done to deter instantiation of LocationSettings elsewhere without using the
    // getInstance() helper method.
    return new LocationSettings() {};
}