Remove Plugin APIs for settings, styles and theme

Change-Id: I346228fab4f5035fa40235ad14a4a59b2cd982b9
diff --git a/polygerrit-ui/app/api/plugin.ts b/polygerrit-ui/app/api/plugin.ts
index b8dd264..3bf5f62 100644
--- a/polygerrit-ui/app/api/plugin.ts
+++ b/polygerrit-ui/app/api/plugin.ts
@@ -23,9 +23,6 @@
 import {EventHelperPluginApi} from './event-helper';
 import {PopupPluginApi} from './popup';
 import {ReportingPluginApi} from './reporting';
-import {SettingsPluginApi} from './settings';
-import {StylesPluginApi} from './styles';
-import {ThemePluginApi} from './theme';
 import {ChangeActionsPluginApi} from './change-actions';
 import {RestPluginApi} from './rest';
 import {HookApi, RegisterOptions} from './hook';
@@ -84,7 +81,4 @@
   restApi(): RestPluginApi;
   // eslint-disable-next-line @typescript-eslint/no-explicit-any
   screen(screenName: string, moduleName?: string): any;
-  settings(): SettingsPluginApi;
-  styles(): StylesPluginApi;
-  theme(): ThemePluginApi;
 }
diff --git a/polygerrit-ui/app/api/settings.ts b/polygerrit-ui/app/api/settings.ts
deleted file mode 100644
index 03cf474..0000000
--- a/polygerrit-ui/app/api/settings.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import {HookApi} from './hook';
-
-export interface SettingsPluginApi {
-  title(newTitle: string): SettingsPluginApi;
-
-  token(newToken: string): SettingsPluginApi;
-
-  module(newModuleName: string): SettingsPluginApi;
-
-  build(): HookApi;
-}
diff --git a/polygerrit-ui/app/api/styles.ts b/polygerrit-ui/app/api/styles.ts
deleted file mode 100644
index 233c3e2..0000000
--- a/polygerrit-ui/app/api/styles.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export interface StyleObject {
-  /**
-   * Creates a new unique CSS class and injects it in a root node of the element
-   * if it hasn't been added yet. A root node is an document or is the
-   * associated shadowRoot. This class can be added to any element with the same
-   * root node.
-   */
-  getClassName(element: Element): string;
-
-  /**
-   * Apply shared style to the element.
-   */
-  apply(element: Element): void;
-}
-
-export interface StylesPluginApi {
-  css(ruleStr: string): StyleObject;
-}
diff --git a/polygerrit-ui/app/api/theme.ts b/polygerrit-ui/app/api/theme.ts
deleted file mode 100644
index 70ffcb3..0000000
--- a/polygerrit-ui/app/api/theme.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export interface ThemePluginApi {
-  setHeaderLogoAndTitle(logoUrl: string, title: string): void;
-}
diff --git a/polygerrit-ui/app/elements/plugins/gr-settings-api/gr-settings-api.ts b/polygerrit-ui/app/elements/plugins/gr-settings-api/gr-settings-api.ts
deleted file mode 100644
index 3f75c0a..0000000
--- a/polygerrit-ui/app/elements/plugins/gr-settings-api/gr-settings-api.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @license
- * Copyright (C) 2017 The Android Open Source Settings
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import '../../settings/gr-settings-view/gr-settings-item';
-import '../../settings/gr-settings-view/gr-settings-menu-item';
-import {PluginApi} from '../../../api/plugin';
-import {SettingsPluginApi} from '../../../api/settings';
-import {appContext} from '../../../services/app-context';
-
-export class GrSettingsApi implements SettingsPluginApi {
-  private _token: string;
-
-  private _title = '(no title)';
-
-  private _moduleName?: string;
-
-  private readonly reporting = appContext.reportingService;
-
-  constructor(readonly plugin: PluginApi) {
-    this.reporting.trackApi(this.plugin, 'settings', 'constructor');
-    // Generate default screen URL token, specific to plugin, and unique(ish).
-    this._token = plugin.getPluginName() + Math.random().toString(36).substr(5);
-  }
-
-  title(newTitle: string) {
-    this.reporting.trackApi(this.plugin, 'settings', 'title');
-    this._title = newTitle;
-    return this;
-  }
-
-  token(newToken: string) {
-    this.reporting.trackApi(this.plugin, 'settings', 'token');
-    this._token = newToken;
-    return this;
-  }
-
-  module(newModuleName: string) {
-    this.reporting.trackApi(this.plugin, 'settings', 'module');
-    this._moduleName = newModuleName;
-    return this;
-  }
-
-  build() {
-    this.reporting.trackApi(this.plugin, 'settings', 'build');
-    if (!this._moduleName) {
-      throw new Error('Settings screen custom element not defined!');
-    }
-    const token = `x/${this.plugin.getPluginName()}/${this._token}`;
-    this.plugin.hook('settings-menu-item').onAttached(el => {
-      const menuItem = document.createElement('gr-settings-menu-item');
-      menuItem.title = this._title;
-      menuItem.setAttribute('href', `#${token}`);
-      el.appendChild(menuItem);
-    });
-    const moduleName = this._moduleName;
-    return this.plugin.hook('settings-screen').onAttached(el => {
-      const item = document.createElement('gr-settings-item');
-      item.title = this._title;
-      item.anchor = token;
-      item.appendChild(document.createElement(moduleName));
-      el.appendChild(item);
-    });
-  }
-}
diff --git a/polygerrit-ui/app/elements/plugins/gr-settings-api/gr-settings-api_test.js b/polygerrit-ui/app/elements/plugins/gr-settings-api/gr-settings-api_test.js
deleted file mode 100644
index 893f3e4..0000000
--- a/polygerrit-ui/app/elements/plugins/gr-settings-api/gr-settings-api_test.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @license
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import '../../../test/common-test-setup-karma.js';
-import '../gr-endpoint-decorator/gr-endpoint-decorator.js';
-import {getPluginLoader} from '../../shared/gr-js-api-interface/gr-plugin-loader.js';
-import {_testOnly_initGerritPluginApi} from '../../shared/gr-js-api-interface/gr-gerrit.js';
-import {html} from '@polymer/polymer/lib/utils/html-tag.js';
-
-const basicFixture = fixtureFromTemplate(html`
-<gr-endpoint-decorator name="settings-menu-item">
-    </gr-endpoint-decorator>
-    <gr-endpoint-decorator name="settings-screen">
-    </gr-endpoint-decorator>
-`);
-
-const pluginApi = _testOnly_initGerritPluginApi();
-
-suite('gr-settings-api tests', () => {
-  let settingsApi;
-
-  setup(() => {
-    let plugin;
-    pluginApi.install(p => { plugin = p; }, '0.1',
-        'http://test.com/plugins/testplugin/static/test.js');
-    getPluginLoader().loadPlugins([]);
-    settingsApi = plugin.settings();
-  });
-
-  teardown(() => {
-    settingsApi = null;
-  });
-
-  test('exists', () => {
-    assert.isOk(settingsApi);
-  });
-
-  test('works', done => {
-    settingsApi
-        .title('foo')
-        .token('bar')
-        .module('some-settings-screen')
-        .build();
-    const element = basicFixture.instantiate();
-    flush(() => {
-      const [menuItemEl, itemEl] = element;
-      const menuItem = menuItemEl.shadowRoot
-          .querySelector('gr-settings-menu-item');
-      assert.isOk(menuItem);
-      assert.equal(menuItem.title, 'foo');
-      assert.equal(menuItem.href, '#x/testplugin/bar');
-      const item = itemEl.shadowRoot
-          .querySelector('gr-settings-item');
-      assert.isOk(item);
-      assert.equal(item.title, 'foo');
-      assert.equal(item.anchor, 'x/testplugin/bar');
-      done();
-    });
-  });
-});
-
diff --git a/polygerrit-ui/app/elements/plugins/gr-styles-api/gr-styles-api.ts b/polygerrit-ui/app/elements/plugins/gr-styles-api/gr-styles-api.ts
deleted file mode 100644
index 9a15bf5..0000000
--- a/polygerrit-ui/app/elements/plugins/gr-styles-api/gr-styles-api.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * @license
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import {StyleObject, StylesPluginApi} from '../../../api/styles';
-import {appContext} from '../../../services/app-context';
-import {PluginApi} from '../../../api/plugin';
-
-/**
- * @fileoverview We should consider dropping support for this API:
- *
- * 1. we need to try avoid using `innerHTML` for xss concerns
- * 2. we have css variables which are more recommended way to custom styling
- */
-
-let styleObjectCount = 0;
-
-interface PgElement extends Element {
-  __pg_js_api_style_tags: {
-    [className: string]: boolean;
-  };
-}
-
-export class GrStyleObject implements StyleObject {
-  private className = '';
-
-  constructor(private readonly rulesStr: string) {
-    this.className = `__pg_js_api_class_${styleObjectCount}`;
-    styleObjectCount++;
-  }
-
-  /**
-   * Creates a new unique CSS class and injects it in a root node of the element
-   * if it hasn't been added yet. A root node is an document or is the
-   * associated shadowRoot. This class can be added to any element with the same
-   * root node.
-   */
-  getClassName(element: Element) {
-    let rootNodeEl = element.getRootNode();
-    if (rootNodeEl === document) {
-      rootNodeEl = document.head;
-    }
-    // TODO(TS): type casting to have correct interface
-    // maybe move this __pg_xxx to attribute
-    const rootNode: PgElement = rootNodeEl as PgElement;
-    if (!rootNode.__pg_js_api_style_tags) {
-      rootNode.__pg_js_api_style_tags = {};
-    }
-    if (!rootNode.__pg_js_api_style_tags[this.className]) {
-      const styleTag = document.createElement('style');
-      styleTag.innerHTML = `.${this.className} { ${this.rulesStr} }`;
-      rootNode.appendChild(styleTag);
-      rootNode.__pg_js_api_style_tags[this.className] = true;
-    }
-    return this.className;
-  }
-
-  /**
-   * Apply shared style to the element.
-   */
-  apply(element: Element) {
-    element.classList.add(this.getClassName(element));
-  }
-}
-
-/**
- * TODO(TS): move to util
- */
-export class GrStylesApi implements StylesPluginApi {
-  private readonly reporting = appContext.reportingService;
-
-  constructor(readonly plugin: PluginApi) {
-    this.reporting.trackApi(this.plugin, 'styles', 'constructor');
-  }
-
-  /**
-   * Creates a new GrStyleObject with specified style properties.
-   */
-  css(ruleStr: string) {
-    this.reporting.trackApi(this.plugin, 'styles', 'css');
-    return new GrStyleObject(ruleStr);
-  }
-}
diff --git a/polygerrit-ui/app/elements/plugins/gr-styles-api/gr-styles-api_test.js b/polygerrit-ui/app/elements/plugins/gr-styles-api/gr-styles-api_test.js
deleted file mode 100644
index 1c606cd..0000000
--- a/polygerrit-ui/app/elements/plugins/gr-styles-api/gr-styles-api_test.js
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * @license
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import '../../../test/common-test-setup-karma.js';
-import '../../shared/gr-js-api-interface/gr-js-api-interface.js';
-import {PolymerElement} from '@polymer/polymer/polymer-element.js';
-import {getPluginLoader} from '../../shared/gr-js-api-interface/gr-plugin-loader.js';
-import {_testOnly_initGerritPluginApi} from '../../shared/gr-js-api-interface/gr-gerrit.js';
-import {html} from '@polymer/polymer/lib/utils/html-tag.js';
-
-class GrStyleTestElement extends PolymerElement {
-  static get is() { return 'gr-style-test-element'; }
-
-  static get template() {
-    return html`<div id="wrapper"></div>`;
-  }
-}
-
-customElements.define(GrStyleTestElement.is, GrStyleTestElement);
-
-const pluginApi = _testOnly_initGerritPluginApi();
-
-suite('gr-styles-api tests', () => {
-  let stylesApi;
-
-  setup(() => {
-    let plugin;
-    pluginApi.install(p => { plugin = p; }, '0.1',
-        'http://test.com/plugins/testplugin/static/test.js');
-    getPluginLoader().loadPlugins([]);
-    stylesApi = plugin.styles();
-  });
-
-  teardown(() => {
-    stylesApi = null;
-  });
-
-  test('exists', () => {
-    assert.isOk(stylesApi);
-  });
-
-  test('css', () => {
-    const styleObject = stylesApi.css('background: red');
-    assert.isDefined(styleObject);
-  });
-
-  suite('GrStyleObject tests', () => {
-    let stylesApi;
-    let displayInlineStyle;
-    let displayNoneStyle;
-    let elementsToRemove;
-
-    setup(() => {
-      let plugin;
-      pluginApi.install(p => { plugin = p; }, '0.1',
-          'http://test.com/plugins/testplugin/static/test.js');
-      getPluginLoader().loadPlugins([]);
-      stylesApi = plugin.styles();
-      displayInlineStyle = stylesApi.css('display: inline');
-      displayNoneStyle = stylesApi.css('display: none');
-      elementsToRemove = [];
-    });
-
-    teardown(() => {
-      displayInlineStyle = null;
-      displayNoneStyle = null;
-      stylesApi = null;
-      elementsToRemove.forEach(element => {
-        element.remove();
-      });
-      elementsToRemove = null;
-      sinon.restore();
-    });
-
-    function createNestedElements(parentElement) {
-      /* parentElement
-      *  |--- element1
-      *  |--- element2
-      *       |--- element3
-      **/
-      const element1 = document.createElement('div');
-      const element2 = document.createElement('div');
-      const element3 = document.createElement('div');
-      parentElement.appendChild(element1);
-      parentElement.appendChild(element2);
-      element2.appendChild(element3);
-
-      if (parentElement === document.body) {
-        elementsToRemove.push(element1);
-        elementsToRemove.push(element2);
-      }
-
-      return [element1, element2, element3];
-    }
-
-    test('getClassName  - body level elements', () => {
-      const bodyLevelElements = createNestedElements(document.body);
-
-      testGetClassName(bodyLevelElements);
-    });
-
-    test('getClassName  - elements inside polymer element', () => {
-      const polymerElement = document.createElement('gr-style-test-element');
-      document.body.appendChild(polymerElement);
-      elementsToRemove.push(polymerElement);
-      const contentElements = createNestedElements(polymerElement.$.wrapper);
-
-      testGetClassName(contentElements);
-    });
-
-    function testGetClassName(elements) {
-      assertAllElementsHaveDefaultStyle(elements);
-
-      const className1 = displayInlineStyle.getClassName(elements[0]);
-      const className2 = displayNoneStyle.getClassName(elements[1]);
-      const className3 = displayInlineStyle.getClassName(elements[2]);
-
-      assert.notEqual(className2, className1);
-      assert.equal(className3, className1);
-
-      assertAllElementsHaveDefaultStyle(elements);
-
-      elements[0].classList.add(className1);
-      elements[1].classList.add(className2);
-      elements[2].classList.add(className1);
-
-      assertDisplayPropertyValues(elements, ['inline', 'none', 'inline']);
-    }
-
-    test('apply - body level elements', () => {
-      const bodyLevelElements = createNestedElements(document.body);
-
-      testApply(bodyLevelElements);
-    });
-
-    test('apply - elements inside polymer element', () => {
-      const polymerElement = document.createElement('gr-style-test-element');
-      document.body.appendChild(polymerElement);
-      elementsToRemove.push(polymerElement);
-      const contentElements = createNestedElements(polymerElement.$.wrapper);
-
-      testApply(contentElements);
-    });
-
-    function testApply(elements) {
-      assertAllElementsHaveDefaultStyle(elements);
-      displayInlineStyle.apply(elements[0]);
-      displayNoneStyle.apply(elements[1]);
-      displayInlineStyle.apply(elements[2]);
-      assertDisplayPropertyValues(elements, ['inline', 'none', 'inline']);
-    }
-
-    function assertAllElementsHaveDefaultStyle(elements) {
-      for (const element of elements) {
-        assert.equal(getComputedStyle(element).getPropertyValue('display'),
-            'block');
-      }
-    }
-
-    function assertDisplayPropertyValues(elements, expectedDisplayValues) {
-      for (let i = 0; i < elements.length; i++) {
-        assert.equal(
-            getComputedStyle(elements[i]).getPropertyValue('display'),
-            expectedDisplayValues[i]);
-      }
-    }
-  });
-});
-
diff --git a/polygerrit-ui/app/elements/plugins/gr-theme-api/gr-theme-api.ts b/polygerrit-ui/app/elements/plugins/gr-theme-api/gr-theme-api.ts
deleted file mode 100644
index c7be7f6..0000000
--- a/polygerrit-ui/app/elements/plugins/gr-theme-api/gr-theme-api.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * @license
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import './gr-custom-plugin-header';
-import {GrCustomPluginHeader} from './gr-custom-plugin-header';
-import {PluginApi} from '../../../api/plugin';
-import {ThemePluginApi} from '../../../api/theme';
-import {appContext} from '../../../services/app-context';
-
-/**
- * Defines api for theme, can be used to set header logo and title.
- */
-export class GrThemeApi implements ThemePluginApi {
-  private readonly reporting = appContext.reportingService;
-
-  constructor(private readonly plugin: PluginApi) {
-    this.reporting.trackApi(this.plugin, 'theme', 'constructor');
-  }
-
-  setHeaderLogoAndTitle(logoUrl: string, title: string) {
-    this.reporting.trackApi(this.plugin, 'theme', 'setHeaderLogoAndTitle');
-    this.plugin.hook('header-title', {replace: true}).onAttached(element => {
-      const customHeader: GrCustomPluginHeader = document.createElement(
-        'gr-custom-plugin-header'
-      );
-      customHeader.logoUrl = logoUrl;
-      customHeader.title = title;
-      element.appendChild(customHeader);
-    });
-  }
-}
diff --git a/polygerrit-ui/app/elements/plugins/gr-theme-api/gr-theme-api_test.js b/polygerrit-ui/app/elements/plugins/gr-theme-api/gr-theme-api_test.js
deleted file mode 100644
index 787ab0b..0000000
--- a/polygerrit-ui/app/elements/plugins/gr-theme-api/gr-theme-api_test.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * @license
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import '../../../test/common-test-setup-karma.js';
-import '../gr-endpoint-decorator/gr-endpoint-decorator.js';
-import {getPluginLoader} from '../../shared/gr-js-api-interface/gr-plugin-loader.js';
-import {_testOnly_initGerritPluginApi} from '../../shared/gr-js-api-interface/gr-gerrit.js';
-import {html} from '@polymer/polymer/lib/utils/html-tag.js';
-
-const headerTitleFixture = fixtureFromTemplate(html`
-<gr-endpoint-decorator name="header-title">
-      <span class="titleText"></span>
-    </gr-endpoint-decorator>
-`);
-
-const pluginApi = _testOnly_initGerritPluginApi();
-
-suite('gr-theme-api tests', () => {
-  let theme;
-
-  setup(() => {
-    let plugin;
-    pluginApi.install(p => { plugin = p; }, '0.1',
-        'http://test.com/plugins/testplugin/static/test.js');
-    theme = plugin.theme();
-  });
-
-  teardown(() => {
-    theme = null;
-  });
-
-  test('exists', () => {
-    assert.isOk(theme);
-  });
-
-  suite('header-title', () => {
-    let customHeader;
-
-    setup(() => {
-      headerTitleFixture.instantiate();
-      stub('gr-custom-plugin-header', {
-        /** @override */
-        ready() { customHeader = this; },
-      });
-      getPluginLoader().loadPlugins([]);
-    });
-
-    test('sets logo and title', done => {
-      theme.setHeaderLogoAndTitle('foo.jpg', 'bar');
-      flush(() => {
-        assert.isNotNull(customHeader);
-        assert.equal(customHeader.logoUrl, 'foo.jpg');
-        assert.equal(customHeader.title, 'bar');
-        done();
-      });
-    });
-  });
-});
-
diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.js b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.js
index a7fda9c..da59be1 100644
--- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.js
+++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.js
@@ -18,7 +18,6 @@
 import '../../../test/common-test-setup-karma.js';
 import './gr-js-api-interface.js';
 import {GrPopupInterface} from '../../plugins/gr-popup-interface/gr-popup-interface.js';
-import {GrSettingsApi} from '../../plugins/gr-settings-api/gr-settings-api.js';
 import {EventType} from '../../../api/plugin.js';
 import {PLUGIN_LOADING_TIMEOUT_MS} from './gr-api-utils.js';
 import {getPluginLoader} from './gr-plugin-loader.js';
@@ -453,12 +452,5 @@
           'testplugin-screen-foo', 'some-module'));
     });
   });
-
-  suite('settingsScreen', () => {
-    test('plugin.settings() returns GrSettingsApi', () => {
-      assert.isOk(plugin.settings());
-      assert.isTrue(plugin.settings() instanceof GrSettingsApi);
-    });
-  });
 });
 
diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-public-js-api.ts b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-public-js-api.ts
index aa08c0a..d31316a 100644
--- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-public-js-api.ts
+++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-public-js-api.ts
@@ -20,15 +20,12 @@
 import {GrChangeActionsInterface} from './gr-change-actions-js-api';
 import {GrChangeReplyInterface} from './gr-change-reply-js-api';
 import {GrDomHooksManager} from '../../plugins/gr-dom-hooks/gr-dom-hooks';
-import {GrThemeApi} from '../../plugins/gr-theme-api/gr-theme-api';
 import {GrPopupInterface} from '../../plugins/gr-popup-interface/gr-popup-interface';
 import {GrAdminApi} from '../../plugins/gr-admin-api/gr-admin-api';
 import {GrAnnotationActionsInterface} from './gr-annotation-actions-js-api';
 import {GrChangeMetadataApi} from '../../plugins/gr-change-metadata-api/gr-change-metadata-api';
 import {GrEventHelper} from '../../plugins/gr-event-helper/gr-event-helper';
 import {GrPluginRestApi} from './gr-plugin-rest-api';
-import {GrSettingsApi} from '../../plugins/gr-settings-api/gr-settings-api';
-import {GrStylesApi} from '../../plugins/gr-styles-api/gr-styles-api';
 import {getPluginEndpoints} from './gr-plugin-endpoints';
 
 import {getPluginNameFromUrl, PRELOADED_PROTOCOL, send} from './gr-api-utils';
@@ -41,11 +38,8 @@
 import {appContext} from '../../../services/app-context';
 import {AdminPluginApi} from '../../../api/admin';
 import {AnnotationPluginApi} from '../../../api/annotation';
-import {StylesPluginApi} from '../../../api/styles';
-import {ThemePluginApi} from '../../../api/theme';
 import {EventHelperPluginApi} from '../../../api/event-helper';
 import {PopupPluginApi} from '../../../api/popup';
-import {SettingsPluginApi} from '../../../api/settings';
 import {ReportingPluginApi} from '../../../api/reporting';
 import {ChangeActionsPluginApi} from '../../../api/change-actions';
 import {ChangeMetadataPluginApi} from '../../../api/change-metadata';
@@ -279,10 +273,6 @@
     return new GrReportingJsApi(this);
   }
 
-  theme(): ThemePluginApi {
-    return new GrThemeApi(this);
-  }
-
   changeMetadata(): ChangeMetadataPluginApi {
     return new GrChangeMetadataApi(this);
   }
@@ -291,14 +281,6 @@
     return new GrAdminApi(this);
   }
 
-  settings(): SettingsPluginApi {
-    return new GrSettingsApi(this);
-  }
-
-  styles(): StylesPluginApi {
-    return new GrStylesApi(this);
-  }
-
   restApi(prefix?: string): RestPluginApi {
     return new GrPluginRestApi(this, prefix);
   }