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

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

Issue 2766093002: MD Settings: validate home button url input (Closed)
Patch Set: Merge branch 'master' into home-button Created 3 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 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 /** @return {!Promise<number>} */ 10 /** @return {!Promise<number>} */
11 getDefaultZoom: assertNotReached, 11 getDefaultZoom: assertNotReached,
12 12
13 /** 13 /**
14 * @param {string} themeId 14 * @param {string} themeId
15 * @return {!Promise<!chrome.management.ExtensionInfo>} Theme info. 15 * @return {!Promise<!chrome.management.ExtensionInfo>} Theme info.
16 */ 16 */
17 getThemeInfo: assertNotReached, 17 getThemeInfo: assertNotReached,
18 18
19 /** @return {boolean} Whether the current profile is supervised. */ 19 /** @return {boolean} Whether the current profile is supervised. */
20 isSupervised: assertNotReached, 20 isSupervised: assertNotReached,
21 21
22 // <if expr="chromeos"> 22 // <if expr="chromeos">
23 openWallpaperManager: assertNotReached, 23 openWallpaperManager: assertNotReached,
24 // </if> 24 // </if>
25 25
26 useDefaultTheme: assertNotReached, 26 useDefaultTheme: assertNotReached,
27 27
28 // <if expr="is_linux and not chromeos"> 28 // <if expr="is_linux and not chromeos">
29 useSystemTheme: assertNotReached, 29 useSystemTheme: assertNotReached,
30 // </if> 30 // </if>
31
32 /**
33 * @param {string} url The url of which to check validity.
34 * @return {!Promise<boolean>}
35 */
36 validateStartupPage: assertNotReached
dpapad 2017/03/24 21:47:43 Nit (optional): It's OK to add a trailing comma he
scottchen 2017/03/24 22:56:31 Done.
31 }; 37 };
32 38
33 /** 39 /**
34 * @implements {settings.AppearanceBrowserProxy} 40 * @implements {settings.AppearanceBrowserProxy}
35 * @constructor 41 * @constructor
36 */ 42 */
37 function AppearanceBrowserProxyImpl() {} 43 function AppearanceBrowserProxyImpl() {}
38 44
39 cr.addSingletonGetter(AppearanceBrowserProxyImpl); 45 cr.addSingletonGetter(AppearanceBrowserProxyImpl);
40 46
(...skipping 10 matching lines...) Expand all
51 return new Promise(function(resolve) { 57 return new Promise(function(resolve) {
52 chrome.management.get(themeId, resolve); 58 chrome.management.get(themeId, resolve);
53 }); 59 });
54 }, 60 },
55 61
56 /** @override */ 62 /** @override */
57 isSupervised: function() { 63 isSupervised: function() {
58 return loadTimeData.getBoolean('isSupervised'); 64 return loadTimeData.getBoolean('isSupervised');
59 }, 65 },
60 66
61 // <if expr="chromeos"> 67 // <if expr="chromeos">
62 /** @override */ 68 /** @override */
63 openWallpaperManager: function() { 69 openWallpaperManager: function() {
64 chrome.send('openWallpaperManager'); 70 chrome.send('openWallpaperManager');
65 }, 71 },
66 // </if> 72 // </if>
67 73
68 /** @override */ 74 /** @override */
69 useDefaultTheme: function() { 75 useDefaultTheme: function() {
70 chrome.send('useDefaultTheme'); 76 chrome.send('useDefaultTheme');
71 }, 77 },
72 78
73 // <if expr="is_linux and not chromeos"> 79 // <if expr="is_linux and not chromeos">
74 /** @override */ 80 /** @override */
75 useSystemTheme: function() { 81 useSystemTheme: function() {
76 chrome.send('useSystemTheme'); 82 chrome.send('useSystemTheme');
77 }, 83 },
78 // </if> 84 // </if>
85
86 /** @override */
87 validateStartupPage: function(url) {
88 return cr.sendWithPromise('validateStartupPage', url);
89 },
79 }; 90 };
80 91
81 return { 92 return {
82 AppearanceBrowserProxy: AppearanceBrowserProxy, 93 AppearanceBrowserProxy: AppearanceBrowserProxy,
83 AppearanceBrowserProxyImpl: AppearanceBrowserProxyImpl, 94 AppearanceBrowserProxyImpl: AppearanceBrowserProxyImpl,
84 }; 95 };
85 }); 96 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698