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

Unified Diff: chrome/browser/resources/settings/system_page/system_page_browser_proxy.js

Issue 1814703004: MD Settings: implement "RESTART" button for hardware acceleration to take effect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests Created 4 years, 9 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
Index: chrome/browser/resources/settings/system_page/system_page_browser_proxy.js
diff --git a/chrome/browser/resources/settings/system_page/system_page_browser_proxy.js b/chrome/browser/resources/settings/system_page/system_page_browser_proxy.js
new file mode 100644
index 0000000000000000000000000000000000000000..bfaf1b25c88df1b58d10a1679288de3ea374c667
--- /dev/null
+++ b/chrome/browser/resources/settings/system_page/system_page_browser_proxy.js
@@ -0,0 +1,54 @@
+// 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 Handles interprocess communcation for the system page. */
+
+cr.define('settings', function() {
+ /** @interface */
+ function SystemPageBrowserProxy() {}
+
+ SystemPageBrowserProxy.prototype = {
+ /** Allows the user to change native system proxy settings. */
+ changeProxySettings: assertNotReached,
dpapad 2016/03/21 18:17:38 Nit: Is assertNotReached() useful here (instead of
Dan Beam 2016/03/22 02:16:59 pre-Done (I don't feel strongly enough to slow dow
dpapad 2016/03/22 02:40:04 I don't think it is detrimental (which is why I pr
Dan Beam 2016/03/22 03:06:36 yeah, this is what I guessed (that it just makes t
+
+ /** Restarts Chrome so "Use hardware acceleration" can take effect. */
+ restartBrowser: assertNotReached,
+
+ /**
+ * @return {boolean} Whether hardware acceleration was enabled when the user
+ * started Chrome.
+ */
+ wasHardwareAccelerationEnabledAtStartup: assertNotReached,
+ };
+
+ /**
+ * @constructor
+ * @implements {settings.SystemPageBrowserProxy}
+ */
+ function SystemPageBrowserProxyImpl() {}
+
+ cr.addSingletonGetter(SystemPageBrowserProxyImpl);
+
+ SystemPageBrowserProxyImpl.prototype = {
+ /** @override */
+ changeProxySettings: function() {
+ chrome.send('changeProxySettings');
+ },
+
+ /** @override */
+ restartBrowser: function() {
+ chrome.send('restartBrowser');
+ },
+
+ /** @override */
+ wasHardwareAccelerationEnabledAtStartup: function() {
+ return loadTimeData.getBoolean('hardwareAccelerationEnabledAtStartup');
+ },
+ };
+
+ return {
+ SystemPageBrowserProxy: SystemPageBrowserProxy,
+ SystemPageBrowserProxyImpl: SystemPageBrowserProxyImpl,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698