[Webapp Refactor] Clean up remoting.Clipboard.
commitbe79f477e4d1e66e2d80e7bcd5f9689f3fbbcefc
authorkelvinp <kelvinp@chromium.org>
Thu, 9 Apr 2015 03:46:58 +0000 (8 20:46 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 9 Apr 2015 03:47:30 +0000 (9 03:47 +0000)
tree0c866c84bb52c1c01501ed6db00e689bc3762405
parent5a0107a25031f3ad52a5afa15acbb4fac4560d34
[Webapp Refactor] Clean up remoting.Clipboard.

Currently, remoting.Clipboard is exposed as a global, such that it can hook
events across different files, e.g. remoting.js, client_plugin_impl.js, application.js

This CL moves clean up the file by:
1. Only create an instance of the clipboard when a session is connected.  This removes
   the startSession() method on the clipboard.
2. Hook all events (copy/paste/focus changes) from within remoting.clipboard, which
   eliminates the need to have a global and effectively makes all its methods private.
3. Style cleanups, use single quotes for strings, make sure private variables are
   post-fixed with underscores.

BUG=475317

Review URL: https://codereview.chromium.org/1078563002

Cr-Commit-Position: refs/heads/master@{#324354}
remoting/webapp/base/js/application.js
remoting/webapp/crd/js/client_plugin.js
remoting/webapp/crd/js/client_plugin_impl.js
remoting/webapp/crd/js/client_session.js
remoting/webapp/crd/js/clipboard.js
remoting/webapp/crd/js/connected_view.js
remoting/webapp/crd/js/remoting.js