Example usage for com.vaadin.client BrowserInfo isGecko

List of usage examples for com.vaadin.client BrowserInfo isGecko

Introduction

In this page you can find the example usage for com.vaadin.client BrowserInfo isGecko.

Prototype

public boolean isGecko() 

Source Link

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.client.passwordfield.CubaPasswordFieldWidget.java

License:Apache License

public void setAutocomplete(boolean autocomplete) {
    if (autocomplete) {
        getElement().removeAttribute("autocomplete");
    } else {//from  ww w  .ja v  a 2  s.co m
        BrowserInfo browser = BrowserInfo.get();

        if (browser.isIE() || (browser.isGecko() && browser.getGeckoVersion() < 47)
                || (browser.isChrome() && browser.getBrowserMajorVersion() < 49)) {
            getElement().setAttribute("autocomplete", "off");
        } else {
            getElement().setAttribute("autocomplete", "new-password");
        }
    }
}