[global] Remaps self.Common.settings

This CL changes references to self.Common.settings (the global
instance of SDK.Common.Settings) over to
Common.Settings.Settings.instance(). To keep both TypeScript and
Closure happy we must make a method on the Settings class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I04afc8caf64acf29cdda13ef03ad05cfff4786a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091450
Commit-Queue: Paul Lewis <[email protected]>
Reviewed-by: Tim van der Lippe <[email protected]>
diff --git a/front_end/ui/FilterBar.js b/front_end/ui/FilterBar.js
index 6b0f37d..377737d 100644
--- a/front_end/ui/FilterBar.js
+++ b/front_end/ui/FilterBar.js
@@ -30,8 +30,8 @@
 
 import * as Common from '../common/common.js';
 import * as Host from '../host/host.js';
-
 import * as ARIAUtils from './ARIAUtils.js';
+
 import {Icon} from './Icon.js';
 import {KeyboardShortcut, Modifiers} from './KeyboardShortcut.js';
 import {bindCheckbox} from './SettingsUI.js';
@@ -56,7 +56,8 @@
     this.element.classList.add('filter-bar');
 
     // Note: go via self.Common for globally-namespaced singletons.
-    this._stateSetting = self.self.Common.settings.createSetting('filterBar-' + name + '-toggled', !!visibleByDefault);
+    this._stateSetting =
+        Common.Settings.Settings.instance().createSetting('filterBar-' + name + '-toggled', !!visibleByDefault);
     this._filterButton =
         new ToolbarSettingToggle(this._stateSetting, 'largeicon-filter', Common.UIString.UIString('Filter'));
 
diff --git a/front_end/ui/SearchableView.js b/front_end/ui/SearchableView.js
index 00860a2..e8916e9 100644
--- a/front_end/ui/SearchableView.js
+++ b/front_end/ui/SearchableView.js
@@ -30,6 +30,7 @@
  */
 
 import * as Common from '../common/common.js';
+
 import {HistoryInput} from './HistoryInput.js';
 import {Toolbar, ToolbarButton, ToolbarToggle} from './Toolbar.js';
 import {createTextButton} from './UIUtils.js';
@@ -50,7 +51,7 @@
 
     this._searchProvider = searchable;
     // Note: go via self.Common for globally-namespaced singletons.
-    this._setting = settingName ? self.self.Common.settings.createSetting(settingName, {}) : null;
+    this._setting = settingName ? Common.Settings.Settings.instance().createSetting(settingName, {}) : null;
     this._replaceable = false;
 
     this.contentElement.createChild('slot');
diff --git a/front_end/ui/SplitWidget.js b/front_end/ui/SplitWidget.js
index e8e3898..0356973 100644
--- a/front_end/ui/SplitWidget.js
+++ b/front_end/ui/SplitWidget.js
@@ -75,7 +75,7 @@
     this._constraintsInDip = !!constraintsInDip;
     this._resizeStartSizeDIP = 0;
     // Note: go via self.Common for globally-namespaced singletons.
-    this._setting = settingName ? self.self.Common.settings.createSetting(settingName, {}) : null;
+    this._setting = settingName ? Common.Settings.Settings.instance().createSetting(settingName, {}) : null;
 
     this._totalSizeCSS = 0;
     this._totalSizeOtherDimensionCSS = 0;
diff --git a/front_end/ui/ViewManager.js b/front_end/ui/ViewManager.js
index 779d50d..5a15759 100644
--- a/front_end/ui/ViewManager.js
+++ b/front_end/ui/ViewManager.js
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 import * as Common from '../common/common.js';
-
 import * as ARIAUtils from './ARIAUtils.js';
+
 import {ContextMenu} from './ContextMenu.js';  // eslint-disable-line no-unused-vars
 import {Icon} from './Icon.js';
 import {Events as TabbedPaneEvents, TabbedPane} from './TabbedPane.js';
@@ -407,13 +407,13 @@
     this._tabbedPane.addEventListener(TabbedPaneEvents.TabSelected, this._tabSelected, this);
     this._tabbedPane.addEventListener(TabbedPaneEvents.TabClosed, this._tabClosed, this);
     // Note: go via self.Common for globally-namespaced singletons.
-    this._closeableTabSetting = self.self.Common.settings.createSetting(location + '-closeableTabs', {});
+    this._closeableTabSetting = Common.Settings.Settings.instance().createSetting(location + '-closeableTabs', {});
     // Note: go via self.Common for globally-namespaced singletons.
-    this._tabOrderSetting = self.self.Common.settings.createSetting(location + '-tabOrder', {});
+    this._tabOrderSetting = Common.Settings.Settings.instance().createSetting(location + '-tabOrder', {});
     this._tabbedPane.addEventListener(TabbedPaneEvents.TabOrderChanged, this._persistTabOrder, this);
     if (restoreSelection) {
       // Note: go via self.Common for globally-namespaced singletons.
-      this._lastSelectedTabSetting = self.self.Common.settings.createSetting(location + '-selectedTab', '');
+      this._lastSelectedTabSetting = Common.Settings.Settings.instance().createSetting(location + '-selectedTab', '');
     }
     this._defaultTab = defaultTab;