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

Side by Side Diff: chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.js

Issue 2413623004: MD Settings: allow changing to GTK+ theme on Linux (Closed)
Patch Set: rejigger tests Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('settings', function() { 5 cr.define('settings', function() {
6 /** @interface */ 6 /** @interface */
7 function AppearanceBrowserProxy() {} 7 function AppearanceBrowserProxy() {}
8 8
9 AppearanceBrowserProxy.prototype = { 9 AppearanceBrowserProxy.prototype = {
10 /** 10 /**
11 * @return {!Promise<boolean>} Whether the theme may be reset. 11 * @param {string} themeId
12 * @return {!Promise<!chrome.management.ExtensionInfo>} Theme info.
12 */ 13 */
13 getResetThemeEnabled: assertNotReached, 14 getThemeInfo: assertNotReached,
14 15
15 <if expr="chromeos"> 16 <if expr="chromeos">
16 openWallpaperManager: assertNotReached, 17 openWallpaperManager: assertNotReached,
17 </if> 18 </if>
18 19
19 resetTheme: assertNotReached, 20 useDefaultTheme: assertNotReached,
21
22 <if expr="is_linux and not chromeos">
23 useSystemTheme: assertNotReached,
24 </if>
20 }; 25 };
21 26
22 /** 27 /**
23 * @implements {settings.AppearanceBrowserProxy} 28 * @implements {settings.AppearanceBrowserProxy}
24 * @constructor 29 * @constructor
25 */ 30 */
26 function AppearanceBrowserProxyImpl() {} 31 function AppearanceBrowserProxyImpl() {}
27 32
28 cr.addSingletonGetter(AppearanceBrowserProxyImpl); 33 cr.addSingletonGetter(AppearanceBrowserProxyImpl);
29 34
30 AppearanceBrowserProxyImpl.prototype = { 35 AppearanceBrowserProxyImpl.prototype = {
31 /** @override */ 36 /** @override */
32 getResetThemeEnabled: function() { 37 getThemeInfo: function(themeId) {
33 return cr.sendWithPromise('getResetThemeEnabled'); 38 return new Promise(function(resolve) {
39 chrome.management.get(themeId, resolve);
40 });
34 }, 41 },
35 42
36 <if expr="chromeos"> 43 <if expr="chromeos">
37 /** @override */ 44 /** @override */
38 openWallpaperManager: function() { 45 openWallpaperManager: function() {
39 chrome.send('openWallpaperManager'); 46 chrome.send('openWallpaperManager');
40 }, 47 },
41 </if> 48 </if>
42 49
43 /** @override */ 50 /** @override */
44 resetTheme: function() { 51 useDefaultTheme: function() {
45 chrome.send('resetTheme'); 52 chrome.send('useDefaultTheme');
46 }, 53 },
54
55 <if expr="is_linux and not chromeos">
56 /** @override */
57 useSystemTheme: function() {
58 chrome.send('useSystemTheme');
59 },
60 </if>
47 }; 61 };
48 62
49 return { 63 return {
50 AppearanceBrowserProxy: AppearanceBrowserProxy, 64 AppearanceBrowserProxy: AppearanceBrowserProxy,
51 AppearanceBrowserProxyImpl: AppearanceBrowserProxyImpl, 65 AppearanceBrowserProxyImpl: AppearanceBrowserProxyImpl,
52 }; 66 };
53 }); 67 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698