Example usage for com.google.gwt.coreext.client DataBag getBooleanProperty

List of usage examples for com.google.gwt.coreext.client DataBag getBooleanProperty

Introduction

In this page you can find the example usage for com.google.gwt.coreext.client DataBag getBooleanProperty.

Prototype

public static final native boolean getBooleanProperty(JavaScriptObject obj, String prop) ;

Source Link

Usage

From source file:com.google.speedtracer.client.BackgroundPage.java

License:Apache License

private void listenForContentScripts() {
    // A content script connects to us when we want to load data.
    Chrome.getExtension().getOnConnectEvent().addListener(new ConnectEvent.Listener() {
        public void onConnect(final Port port) {
            String portName = port.getName();
            if (portName.equals(DataLoader.DATA_LOAD) || portName.equals(DataLoader.RAW_DATA_LOAD)) {
                // We are loading data.
                doDataLoad(port);//from  www.j av  a 2  s  .  c  om
            }
        }
    });

    // A content script can message us if it detects that we should auto open
    // Speed Tracer for a trampoline file.
    Chrome.getExtension().getOnRequestEvent().addListener(new RequestEvent.Listener() {
        public void onRequest(JavaScriptObject request, Sender sender, SendResponse sendResponse) {
            if (DataBag.getBooleanProperty(request, "autoOpen")) {
                // Open Speed Tracer.
                Tab tab = sender.getTab();
                monitorTabClickListener.onClicked(tab);
                // The Monitor coming alive and calling back should be
                // asynchronous. We should be able to stick in the SendResponse
                // callback in before the Monitor calls back, and then notify the
                // content script after we know the monitor is opened and ready.
                BrowserConnectionState browserConnection = browserConnectionMap.get(CHROME_BROWSER_ID);
                browserConnection.tabMap.get(tab.getId()).monitorOpenedCallback = sendResponse.cast();
            }
        }
    });
}