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

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

Issue 2426863002: MD Settings: don't allow supervised users to switch to GTK+ theme (Closed)
Patch Set: split 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 * @param {string} themeId 11 * @param {string} themeId
12 * @return {!Promise<!chrome.management.ExtensionInfo>} Theme info. 12 * @return {!Promise<!chrome.management.ExtensionInfo>} Theme info.
13 */ 13 */
14 getThemeInfo: assertNotReached, 14 getThemeInfo: assertNotReached,
15 15
16 /** @return {boolean} Whether the current profile is supervised. */
17 isSupervised: assertNotReached,
18
16 <if expr="chromeos"> 19 <if expr="chromeos">
17 openWallpaperManager: assertNotReached, 20 openWallpaperManager: assertNotReached,
18 </if> 21 </if>
19 22
20 useDefaultTheme: assertNotReached, 23 useDefaultTheme: assertNotReached,
21 24
22 <if expr="is_linux and not chromeos"> 25 <if expr="is_linux and not chromeos">
23 useSystemTheme: assertNotReached, 26 useSystemTheme: assertNotReached,
24 </if> 27 </if>
25 }; 28 };
26 29
27 /** 30 /**
28 * @implements {settings.AppearanceBrowserProxy} 31 * @implements {settings.AppearanceBrowserProxy}
29 * @constructor 32 * @constructor
30 */ 33 */
31 function AppearanceBrowserProxyImpl() {} 34 function AppearanceBrowserProxyImpl() {}
32 35
33 cr.addSingletonGetter(AppearanceBrowserProxyImpl); 36 cr.addSingletonGetter(AppearanceBrowserProxyImpl);
34 37
35 AppearanceBrowserProxyImpl.prototype = { 38 AppearanceBrowserProxyImpl.prototype = {
36 /** @override */ 39 /** @override */
37 getThemeInfo: function(themeId) { 40 getThemeInfo: function(themeId) {
38 return new Promise(function(resolve) { 41 return new Promise(function(resolve) {
39 chrome.management.get(themeId, resolve); 42 chrome.management.get(themeId, resolve);
40 }); 43 });
41 }, 44 },
42 45
46 /** @override */
47 isSupervised: function() {
48 return loadTimeData.getBoolean('isSupervised');
49 },
50
43 <if expr="chromeos"> 51 <if expr="chromeos">
44 /** @override */ 52 /** @override */
45 openWallpaperManager: function() { 53 openWallpaperManager: function() {
46 chrome.send('openWallpaperManager'); 54 chrome.send('openWallpaperManager');
47 }, 55 },
48 </if> 56 </if>
49 57
50 /** @override */ 58 /** @override */
51 useDefaultTheme: function() { 59 useDefaultTheme: function() {
52 chrome.send('useDefaultTheme'); 60 chrome.send('useDefaultTheme');
53 }, 61 },
54 62
55 <if expr="is_linux and not chromeos"> 63 <if expr="is_linux and not chromeos">
56 /** @override */ 64 /** @override */
57 useSystemTheme: function() { 65 useSystemTheme: function() {
58 chrome.send('useSystemTheme'); 66 chrome.send('useSystemTheme');
59 }, 67 },
60 </if> 68 </if>
61 }; 69 };
62 70
63 return { 71 return {
64 AppearanceBrowserProxy: AppearanceBrowserProxy, 72 AppearanceBrowserProxy: AppearanceBrowserProxy,
65 AppearanceBrowserProxyImpl: AppearanceBrowserProxyImpl, 73 AppearanceBrowserProxyImpl: AppearanceBrowserProxyImpl,
66 }; 74 };
67 }); 75 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698