Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2068)

Unified Diff: Source/devtools/front_end/main/AdvancedApp.js

Issue 1164933008: [DevTools] Extract DeviceModeButton from AdvancedApp. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/emulation/module.json ('k') | Source/devtools/front_end/main/module.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/main/AdvancedApp.js
diff --git a/Source/devtools/front_end/main/AdvancedApp.js b/Source/devtools/front_end/main/AdvancedApp.js
index 78b9fe896330596f6554dbc0a798427a5a47faf6..d0b5317e9b5436b52a6827e01fac158c839e6a73 100644
--- a/Source/devtools/front_end/main/AdvancedApp.js
+++ b/Source/devtools/front_end/main/AdvancedApp.js
@@ -8,35 +8,10 @@
*/
WebInspector.AdvancedApp = function()
{
- this._toggleEmulationButton = new WebInspector.ToolbarButton(WebInspector.UIString("Toggle device mode"), "emulation-toolbar-item");
- this._toggleEmulationButton.setToggled(WebInspector.overridesSupport.emulationEnabled());
- this._toggleEmulationButton.addEventListener("click", this._toggleEmulationEnabled, this);
- WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport.Events.EmulationStateChanged, this._emulationEnabledChanged, this);
- WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport.Events.OverridesWarningUpdated, this._overridesWarningUpdated, this);
WebInspector.dockController.addEventListener(WebInspector.DockController.Events.BeforeDockSideChanged, this._openToolboxWindow, this);
};
WebInspector.AdvancedApp.prototype = {
- _toggleEmulationEnabled: function()
- {
- var enabled = !this._toggleEmulationButton.toggled();
- WebInspector.overridesSupport.setEmulationEnabled(enabled);
- },
-
- _emulationEnabledChanged: function()
- {
- this._toggleEmulationButton.setToggled(WebInspector.overridesSupport.emulationEnabled());
- },
-
- _overridesWarningUpdated: function()
- {
- if (!this._toggleEmulationButton)
- return;
- var message = WebInspector.overridesSupport.warningMessage();
- this._toggleEmulationButton.setTitle(message || WebInspector.UIString("Toggle device mode"));
- this._toggleEmulationButton.element.classList.toggle("warning", !!message);
- },
-
/**
* @param {!Document} document
* @override
@@ -60,8 +35,6 @@ WebInspector.AdvancedApp.prototype = {
WebInspector.dockController.addEventListener(WebInspector.DockController.Events.AfterDockSideChanged, this._onAfterDockSideChange, this);
this._onDockSideChange();
- this._overridesWarningUpdated();
-
WebInspector.inspectorView.showInitialPanel();
console.timeStamp("AdvancedApp.attachToBody");
rootView.attachToDocument(document);
@@ -237,42 +210,3 @@ WebInspector.AdvancedAppProvider.prototype = {
return WebInspector.AdvancedApp._instance();
}
};
-
-/**
- * @constructor
- * @implements {WebInspector.ToolbarItem.Provider}
- */
-WebInspector.AdvancedApp.EmulationButtonProvider = function()
-{
-}
-
-WebInspector.AdvancedApp.EmulationButtonProvider.prototype = {
- /**
- * @override
- * @return {?WebInspector.ToolbarItem}
- */
- item: function()
- {
- return WebInspector.AdvancedApp._instance()._toggleEmulationButton;
- }
-}
-
-/**
- * @constructor
- * @implements {WebInspector.ActionDelegate}
- */
-WebInspector.AdvancedApp.ToggleDeviceModeActionDelegate = function()
-{
-}
-
-WebInspector.AdvancedApp.ToggleDeviceModeActionDelegate.prototype = {
- /**
- * @override
- * @param {!WebInspector.Context} context
- * @param {string} actionId
- */
- handleAction: function(context, actionId)
- {
- WebInspector.AdvancedApp._instance()._toggleEmulationEnabled();
- }
-}
« no previous file with comments | « Source/devtools/front_end/emulation/module.json ('k') | Source/devtools/front_end/main/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698