| OLD | NEW |
| 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 /** @fileoverview Handles interprocess communcation for the privacy page. */ | 5 /** @fileoverview Handles interprocess communcation for the privacy page. */ |
| 6 | 6 |
| 7 /** @typedef {{enabled: boolean, managed: boolean}} */ |
| 8 var MetricsReporting; |
| 9 |
| 7 cr.define('settings', function() { | 10 cr.define('settings', function() { |
| 8 /** @interface */ | 11 /** @interface */ |
| 9 function PrivacyPageBrowserProxy() {} | 12 function PrivacyPageBrowserProxy() {} |
| 10 | 13 |
| 11 PrivacyPageBrowserProxy.prototype = { | 14 PrivacyPageBrowserProxy.prototype = { |
| 15 <if expr="_google_chrome and not chromeos"> |
| 16 /** @return {!Promise<!MetricsReporting>} */ |
| 17 getMetricsReporting: assertNotReached, |
| 18 |
| 19 /** @param {boolean} enabled */ |
| 20 setMetricsReportingEnabled: assertNotReached, |
| 21 </if> |
| 22 |
| 23 <if expr="is_win or is_macosx"> |
| 12 /** Invokes the native certificate manager (used by win and mac). */ | 24 /** Invokes the native certificate manager (used by win and mac). */ |
| 13 showManageSSLCertificates: function() {}, | 25 showManageSSLCertificates: function() {}, |
| 26 </if> |
| 14 }; | 27 }; |
| 15 | 28 |
| 16 /** | 29 /** |
| 17 * @constructor | 30 * @constructor |
| 18 * @implements {settings.PrivacyPageBrowserProxy} | 31 * @implements {settings.PrivacyPageBrowserProxy} |
| 19 */ | 32 */ |
| 20 function PrivacyPageBrowserProxyImpl() {} | 33 function PrivacyPageBrowserProxyImpl() {} |
| 21 cr.addSingletonGetter(PrivacyPageBrowserProxyImpl); | 34 cr.addSingletonGetter(PrivacyPageBrowserProxyImpl); |
| 22 | 35 |
| 23 PrivacyPageBrowserProxyImpl.prototype = { | 36 PrivacyPageBrowserProxyImpl.prototype = { |
| 37 <if expr="_google_chrome and not chromeos"> |
| 38 /** @override */ |
| 39 getMetricsReporting: function() { |
| 40 return cr.sendWithPromise('getMetricsReporting'); |
| 41 }, |
| 42 |
| 43 /** @override */ |
| 44 setMetricsReportingEnabled: function(enabled) { |
| 45 chrome.send('setMetricsReportingEnabled', [enabled]); |
| 46 }, |
| 47 </if> |
| 48 |
| 49 <if expr="is_win or is_macosx"> |
| 24 /** @override */ | 50 /** @override */ |
| 25 showManageSSLCertificates: function() { | 51 showManageSSLCertificates: function() { |
| 26 chrome.send('showManageSSLCertificates'); | 52 chrome.send('showManageSSLCertificates'); |
| 27 }, | 53 }, |
| 54 </if> |
| 28 }; | 55 }; |
| 29 | 56 |
| 30 return { | 57 return { |
| 31 PrivacyPageBrowserProxy: PrivacyPageBrowserProxy, | 58 PrivacyPageBrowserProxy: PrivacyPageBrowserProxy, |
| 32 PrivacyPageBrowserProxyImpl: PrivacyPageBrowserProxyImpl, | 59 PrivacyPageBrowserProxyImpl: PrivacyPageBrowserProxyImpl, |
| 33 }; | 60 }; |
| 34 }); | 61 }); |
| OLD | NEW |