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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/notifications.js

Issue 2123973004: Define a minimum time for double tap in ChromeVox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 4 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * @fileoverview Provides notification support for ChromeVox. 6 * @fileoverview Provides notification support for ChromeVox.
7 */ 7 */
8 8
9 goog.provide('Notifications'); 9 goog.provide('Notifications');
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 /** 67 /**
68 * Set after an update is shown. 68 * Set after an update is shown.
69 * @type {UpdateNotification} 69 * @type {UpdateNotification}
70 */ 70 */
71 Notifications.currentUpdate; 71 Notifications.currentUpdate;
72 72
73 /** 73 /**
74 * Runs notifications that should be shown for startup. 74 * Runs notifications that should be shown for startup.
75 */ 75 */
76 Notifications.onStartup = function() { 76 Notifications.onStartup = function() {
77 return;
78 // Only run on background page. 77 // Only run on background page.
79 if (document.location.href.indexOf('background.html') == -1) 78 if (document.location.href.indexOf('background.html') == -1)
80 return; 79 return;
81 80
82 Notifications.reset(); 81 Notifications.reset();
83 Notifications.currentUpdate = new UpdateNotification(); 82 Notifications.currentUpdate = new UpdateNotification();
84 Notifications.currentUpdate.show(); 83 Notifications.currentUpdate.show();
85 }; 84 };
86 85
87 /** 86 /**
88 * Runs notifications that should be shown for mode changes. 87 * Runs notifications that should be shown for mode changes.
89 */ 88 */
90 Notifications.onModeChange = function() { 89 Notifications.onModeChange = function() {
91 return;
92 // Only run on background page. 90 // Only run on background page.
93 if (document.location.href.indexOf('background.html') == -1) 91 if (document.location.href.indexOf('background.html') == -1)
94 return; 92 return;
95 93
96 if (ChromeVoxState.instance.mode !== ChromeVoxMode.FORCE_NEXT) 94 if (ChromeVoxState.instance.mode !== ChromeVoxMode.FORCE_NEXT)
97 return; 95 return;
98 96
99 Notifications.reset(); 97 Notifications.reset();
100 Notifications.currentUpdate = new UpdateNotification(); 98 Notifications.currentUpdate = new UpdateNotification();
101 Notifications.currentUpdate.show(); 99 Notifications.currentUpdate.show();
102 }; 100 };
103 101
104 /** 102 /**
105 * Resets to a clean state. Future events will trigger update notifications. 103 * Resets to a clean state. Future events will trigger update notifications.
106 */ 104 */
107 Notifications.reset = function() { 105 Notifications.reset = function() {
108 if (Notifications.currentUpdate) 106 if (Notifications.currentUpdate)
109 Notifications.currentUpdate.removeAllListeners(); 107 Notifications.currentUpdate.removeAllListeners();
110 delete localStorage['notifications_update_notification_shown']; 108 delete localStorage['notifications_update_notification_shown'];
111 }; 109 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698