summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js')
-rw-r--r--chromium/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/chromium/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js b/chromium/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js
new file mode 100644
index 00000000000..6852de8b29f
--- /dev/null
+++ b/chromium/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js
@@ -0,0 +1,39 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import {addSingletonGetter, addWebUIListener, sendWithPromise} from 'chrome://resources/js/cr.m.js';
+
+export class TabStripEmbedderProxy {
+ /** @return {boolean} */
+ isVisible() {
+ return document.visibilityState === 'visible';
+ }
+
+ /**
+ * @return {!Promise<!Object<string, string>>} Object with CSS variables
+ * as keys and rgba strings as values
+ */
+ getColors() {
+ return sendWithPromise('getThemeColors');
+ }
+
+ observeThemeChanges() {
+ chrome.send('observeThemeChanges');
+ }
+
+ /**
+ * @param {number} tabId
+ * @param {number} locationX
+ * @param {number} locationY
+ */
+ showTabContextMenu(tabId, locationX, locationY) {
+ chrome.send('showTabContextMenu', [tabId, locationX, locationY]);
+ }
+
+ closeContainer() {
+ chrome.send('closeContainer');
+ }
+}
+
+addSingletonGetter(TabStripEmbedderProxy);