Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 * States that the extension can be in. | 6 * States that the extension can be in. |
| 7 */ | 7 */ |
| 8 var StateEnum = { | 8 var StateEnum = { |
| 9 DISABLED: 'disabled', | 9 DISABLED: 'disabled', |
| 10 DISPLAY: 'display', | 10 DISPLAY: 'display', |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 break; | 88 break; |
| 89 default: | 89 default: |
| 90 throw 'Invalid state "' + state + '"'; | 90 throw 'Invalid state "' + state + '"'; |
| 91 } | 91 } |
| 92 }); | 92 }); |
| 93 }); | 93 }); |
| 94 | 94 |
| 95 chrome.runtime.onStartup.addListener(function() { | 95 chrome.runtime.onStartup.addListener(function() { |
| 96 loadSavedState(function(state) { setState(state); }); | 96 loadSavedState(function(state) { setState(state); }); |
| 97 }); | 97 }); |
| 98 | |
| 99 chrome.runtime.onInstalled.addListener(function(details) { | |
| 100 loadSavedState(function(state) { setState(state); }); | |
|
Matt Perry
2014/09/19 19:47:27
I assume loadSavedState can be called multiple tim
Daniel Erat
2014/09/19 19:53:11
yep, this should be fine. the locks don't stack an
| |
| 101 }); | |
| OLD | NEW |