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

Side by Side Diff: chrome/browser/resources/settings/google_assistant_page/google_assistant_browser_proxy.js

Issue 2952463002: App list sync unit tests (Closed)
Patch Set: Add in dummy hooks for assistant settings launcher Created 3 years, 5 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview A helper object used from the google assistant section
7 * to interact with the browser.
8 */
9
10 cr.define('settings', function() {
11 console.log("setting up assistant browser proxy");
12 /** @interface */
13 class GoogleAssistantBrowserProxy {
14 /**
15 * Enables or disables the Google Assistant.
16 * @param {boolean} assistantEnabled
17 */
18 setGoogleAssistantEnabled(assistantEnabled) {}
19
20 /**
21 * Enables or disables screen context for the Google Assistant.
22 * @param {boolean} contextEnabled
23 */
24 setGoogleAssistantContextEnabled(contextEnabled) {}
25
26 /**
27 * Launches into the Google Assistant app settings.
28 */
29 launchGoogleAssistantSettings() {}
30 }
31
32 /**
33 * @implements {settings.GoogleAssistantBrowserProxy}
34 */
35 class GoogleAssistantBrowserProxyImpl {
36 /** @override */
37 setGoogleAssistantEnabled(assistantEnabled) {
38 chrome.send('setGoogleAssistantEnabled', [assistantEnabled]);
39 }
40
41 /** @override */
42 setGoogleAssistantContextEnabled(contextEnabled) {
43 chrome.send('setGoogleAssistantContextEnabled', [contextEnabled]);
44 }
45
46 /** @override */
47 showGoogleAssistantSettings() {
48 chrome.send('showGoogleAssistantSettings');
49 }
50
51 }
52
53 // The singleton instance_ is replaced with a test version of this wrapper
54 // during testing.
55 cr.addSingletonGetter(GoogleAssistantBrowserProxyImpl);
56
57 return {
58 GoogleAssistantBrowserProxy: GoogleAssistantBrowserProxy,
59 GoogleAssistantBrowserProxyImpl: GoogleAssistantBrowserProxyImpl,
60 };
61 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698