diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-07-14 17:41:05 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-04 12:37:36 +0000 |
commit | 399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (patch) | |
tree | 6b06b60ff365abef0e13b3503d593a0df48d20e8 /chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js | |
parent | 7366110654eec46f21b6824f302356426f48cd74 (diff) |
BASELINE: Update Chromium to 52.0.2743.76 and Ninja to 1.7.1
Change-Id: I382f51b959689505a60f8b707255ecb344f7d8b4
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js')
-rw-r--r-- | chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js | 168 |
1 files changed, 168 insertions, 0 deletions
diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js b/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js new file mode 100644 index 00000000000..491eddeb8be --- /dev/null +++ b/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js @@ -0,0 +1,168 @@ +// Copyright 2016 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. + +/** + * @fileoverview A helper object used from the "About" section to interact with + * the browser. + */ + +<if expr="chromeos"> +/** + * @typedef {{ + * text: string, + * url: string, + * }} + */ +var RegulatoryInfo; + +/** + * @typedef {{ + * arcVersion: string, + * osFirmware: string, + * osVersion: string, + * }} + */ +var VersionInfo; + +/** + * Enumeration of all possible browser channels. + * @enum {string} + */ +var BrowserChannel = { + BETA: 'beta-channel', + DEV: 'dev-channel', + STABLE: 'stable-channel', +}; +</if> + +cr.define('settings', function() { + /** @interface */ + function AboutPageBrowserProxy() {} + + AboutPageBrowserProxy.prototype = { + /** + * Indicates to the browser that the page is ready. + */ + pageReady: function() {}, + + /** + * Request update status from the browser. It results in one or more + * 'update-status-changed' WebUI events. + */ + refreshUpdateStatus: function() {}, + + /** + * Relaunches the browser. + */ + relaunchNow: function() {}, + + /** Opens the help page. */ + openHelpPage: function() {}, + +<if expr="_google_chrome"> + /** + * Opens the feedback dialog. + */ + openFeedbackDialog: function() {}, +</if> + +<if expr="chromeos"> + /** + * Checks for available update and applies if it exists. + */ + requestUpdate: function() {}, + + /** + * @param {!BrowserChannel} channel + * @param {boolean} isPowerwashAllowed + */ + setChannel: function(channel, isPowerwashAllowed) {}, + + /** @return {!Promise<!BrowserChannel>} */ + getCurrentChannel: function() {}, + + /** @return {!Promise<!BrowserChannel>} */ + getTargetChannel: function() {}, + + /** @return {!Promise<!VersionInfo>} */ + getVersionInfo: function() {}, + + /** @return {!Promise<?RegulatoryInfo>} */ + getRegulatoryInfo: function() {}, +</if> + }; + + /** + * @implements {settings.AboutPageBrowserProxy} + * @constructor + */ + function AboutPageBrowserProxyImpl() {} + cr.addSingletonGetter(AboutPageBrowserProxyImpl); + + AboutPageBrowserProxyImpl.prototype = { + /** @override */ + pageReady: function() { + chrome.send('aboutPageReady'); + }, + + /** @override */ + refreshUpdateStatus: function() { + chrome.send('refreshUpdateStatus'); + }, + + /** @override */ + relaunchNow: function() { + chrome.send('relaunchNow'); + }, + + /** @override */ + openHelpPage: function() { + chrome.send('openHelpPage'); + }, + +<if expr="_google_chrome"> + /** @override */ + openFeedbackDialog: function() { + chrome.send('openFeedbackDialog'); + }, +</if> + +<if expr="chromeos"> + /** @override */ + requestUpdate: function() { + chrome.send('requestUpdate'); + }, + + /** @override */ + setChannel: function(channel, isPowerwashAllowed) { + chrome.send('setChannel', [channel, isPowerwashAllowed]); + }, + + /** @override */ + getCurrentChannel: function() { + return cr.sendWithPromise('getCurrentChannel'); + }, + + /** @override */ + getTargetChannel: function() { + return cr.sendWithPromise('getTargetChannel'); + }, + + /** @override */ + getVersionInfo: function() { + return cr.sendWithPromise('getVersionInfo'); + }, + + /** @override */ + getRegulatoryInfo: function() { + return cr.sendWithPromise('getRegulatoryInfo'); + } +</if> + }; + + return { + AboutPageBrowserProxy: AboutPageBrowserProxy, + AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl, + }; +}); |