| Index: chrome/browser/resources/chromeos/cryptohome.js
|
| diff --git a/chrome/browser/resources/chromeos/cryptohome.js b/chrome/browser/resources/chromeos/cryptohome.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..40b172045b0369455a9dd4de30bdec5f3bfeeedd
|
| --- /dev/null
|
| +++ b/chrome/browser/resources/chromeos/cryptohome.js
|
| @@ -0,0 +1,26 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +/**
|
| + * Sets |value| to the element specified by |destination_id|.
|
| + * Called from C++ code as a result of RequestCryptohomeProperty() call.
|
| + * @param {string} destination_id Id of the element to be modified.
|
| + * @param {string} value The value to be set.
|
| + */
|
| +function SetCryptohomeProperty(destination_id, value) {
|
| + $(destination_id).textContent = value;
|
| +}
|
| +
|
| +document.addEventListener('DOMContentLoaded', function() {
|
| + // Request update.
|
| + chrome.send('pageLoaded');
|
| +
|
| + // Auto-refresh when interval is given as pathname.
|
| + var interval = parseInt(window.location.pathname.split('/')[1]);
|
| + if (interval > 0) {
|
| + $('refresh-message').textContent =
|
| + '(Auto-refreshing page every ' + interval + 's)';
|
| + setTimeout(function() { window.location.reload(true); }, interval * 1000);
|
| + }
|
| +});
|
|
|