Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / devtools / front_end / devices / DevicesView.js
index 95248d0..cdbec2f 100644 (file)
@@ -21,6 +21,7 @@ WebInspector.DevicesView = function()
     this.element.createChild("div", "devices-info").innerHTML = WebInspector.UIString("Click \"Try here\" button, to open the current page in the selected remote browser.");
     this._devicesList = this.element.createChild("div");
     this._devicesList.cellSpacing = 0;
+    InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.DevicesUpdated, this._onDevicesUpdated, this);
 };
 
 WebInspector.DevicesView.MinVersionNewTab = 29;
@@ -43,7 +44,7 @@ WebInspector.DevicesView.Events = {
 };
 
 WebInspector.DevicesView.prototype = {
-    _onDevicesChanged: function(event)
+    _onDevicesUpdated: function(event)
     {
         this._updateDeviceList(/** @type {!Array.<!Adb.Device>} */(event.data));
     },
@@ -161,7 +162,7 @@ WebInspector.DevicesView.prototype = {
                             ? WebInspector.UIString("You may need a newer version of desktop Chrome. Please try Chrome %s  or later.", browser.adbBrowserVersion)
                             : WebInspector.UIString("You may need a newer version of Chrome on your device. Please try Chrome %s or later.", WebInspector.DevicesView.MinVersionNewTab);
                     } else {
-                        var newPageButton = browserSection.createChild("button", "settings-tab-text-button");
+                        var newPageButton = browserSection.createChild("button", "text-button");
                         newPageButton.textContent = WebInspector.UIString("Try here");
                         newPageButton.title = WebInspector.UIString("Inspect current page in this browser.");
                         newPageButton.addEventListener("click", InspectorFrontendHost.openUrlOnRemoteDeviceAndInspect.bind(null, browser.id, WebInspector.resourceTreeModel.inspectedPageURL()), true);
@@ -174,12 +175,12 @@ WebInspector.DevicesView.prototype = {
 
     willHide: function()
     {
-        WebInspector.inspectorFrontendEventSink.removeEventListener(WebInspector.DevicesView.Events.DevicesChanged, this._onDevicesChanged, this);
+        InspectorFrontendHost.setDevicesUpdatesEnabled(false);
     },
 
     wasShown: function()
     {
-        WebInspector.inspectorFrontendEventSink.addEventListener(WebInspector.DevicesView.Events.DevicesChanged, this._onDevicesChanged, this);
+        InspectorFrontendHost.setDevicesUpdatesEnabled(true);
     },
 
     __proto__: WebInspector.VBox.prototype