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

The following examples show how to use org.chromium.chrome.browser.preferences.LocationSettings. 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 File: LocationCategory.java    From delion with 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 File: LocationCategory.java    From AndroidChromium with 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 File: LocationCategory.java    From 365browser with 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 File: ChromeApplication.java    From delion with 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 File: ChromeApplication.java    From AndroidChromium with 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 File: AppHooks.java    From 365browser with 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() {};
}