summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-14 23:07:01 +0000
committerjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-14 23:07:01 +0000
commit90f38e213e3dd82ac87894a089647b0081c727d7 (patch)
tree07fa80a239511f97ddda160265d5a9e6e1a524b0 /remoting
parent6b3875b6b78866d0446f5d4c6293a65c3d168f22 (diff)
downloadchromium_src-90f38e213e3dd82ac87894a089647b0081c727d7.zip
chromium_src-90f38e213e3dd82ac87894a089647b0081c727d7.tar.gz
chromium_src-90f38e213e3dd82ac87894a089647b0081c727d7.tar.bz2
Persist remoting.useP2pApi
BUG=None TEST=Manual Review URL: http://codereview.chromium.org/7887054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101186 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/webapp/me2mom/client_session.js6
-rw-r--r--remoting/webapp/me2mom/remoting.js20
2 files changed, 20 insertions, 6 deletions
diff --git a/remoting/webapp/me2mom/client_session.js b/remoting/webapp/me2mom/client_session.js
index 5f634f7..7cbbb0d 100644
--- a/remoting/webapp/me2mom/client_session.js
+++ b/remoting/webapp/me2mom/client_session.js
@@ -16,12 +16,6 @@
/** @suppress {duplicate} */
var remoting = remoting || {};
-/**
- * Whether or not the P2P Transport API should be used.
- * @type {boolean}
- */
-remoting.useP2pApi = false;
-
(function() {
/**
* @param {string} hostJid The jid of the host to connect to.
diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js
index 3b1434d..6e64d30 100644
--- a/remoting/webapp/me2mom/remoting.js
+++ b/remoting/webapp/me2mom/remoting.js
@@ -54,9 +54,18 @@ remoting.ClientError = {
*/
remoting.scaleToFit = false;
+/**
+ * Whether or not the P2P Transport API should be used. This flag is an interim
+ * measure to allow testing by early adopters, and will be removed when P2P API
+ * is enabled by default. See http://crbug.com/51198 for details.
+ * @type {boolean}
+ */
+remoting.useP2pApi = false;
+
// Constants representing keys used for storing persistent application state.
var KEY_APP_MODE_ = 'remoting-app-mode';
var KEY_EMAIL_ = 'remoting-email';
+var KEY_USE_P2P_API_ = 'remoting-use-p2p-api';
// Some constants for pretty-printing the access code.
var kSupportIdLen = 7;
@@ -171,6 +180,8 @@ remoting.init = function() {
document.getElementById('client-footer-text-cros').id =
'client-footer-text';
}
+
+ remoting.useP2pApi = !(window.localStorage.getItem(KEY_USE_P2P_API_) == null);
}
/**
@@ -704,4 +715,13 @@ remoting.checkHotkeys = function(event) {
}
}
+remoting.setUseP2pApi = function(use) {
+ remoting.useP2pApi = use;
+ if (use) {
+ window.localStorage.setItem(KEY_USE_P2P_API_, 'true');
+ } else {
+ window.localStorage.removeItem(KEY_USE_P2P_API_);
+ }
+}
+
}());