| 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 /** | 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 /** | 59 /** |
| 60 * Runs notifications that should be shown for startup. | 60 * Runs notifications that should be shown for startup. |
| 61 */ | 61 */ |
| 62 Notifications.onStartup = function() { | 62 Notifications.onStartup = function() { |
| 63 // Only run on background page. | 63 // Only run on background page. |
| 64 if (document.location.href.indexOf('background.html') == -1) | 64 if (document.location.href.indexOf('background.html') == -1) |
| 65 return; | 65 return; |
| 66 | 66 |
| 67 new UpdateNotification().show(); | 67 new UpdateNotification().show(); |
| 68 }; | 68 }; |
| 69 | |
| 70 /** | |
| 71 * Runs notifications that should be shown for mode changes. | |
| 72 */ | |
| 73 Notifications.onModeChange = function() { | |
| 74 // Only run on background page. | |
| 75 if (document.location.href.indexOf('background.html') == -1) | |
| 76 return; | |
| 77 | |
| 78 if (ChromeVoxState.instance.mode !== ChromeVoxMode.FORCE_NEXT) | |
| 79 return; | |
| 80 | |
| 81 new UpdateNotification().show(); | |
| 82 }; | |
| OLD | NEW |