Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Namespace for the share dialog mock. | 5 // Namespace for the share dialog mock. |
| 6 var shareDialog = {}; | 6 var shareDialog = {}; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Origin of Files.app. | 9 * Origin of Files.app. |
| 10 * @type {string} | 10 * @type {string} |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 * Handles an event from the embedder than preparation resize the window is | 85 * Handles an event from the embedder than preparation resize the window is |
| 86 * done. | 86 * done. |
| 87 * @private | 87 * @private |
| 88 */ | 88 */ |
| 89 shareDialog.onResizeComplete_ = function() { | 89 shareDialog.onResizeComplete_ = function() { |
| 90 var container = document.querySelector('#container'); | 90 var container = document.querySelector('#container'); |
| 91 container.style.width = shareDialog.TARGET_WIDTH + 'px'; | 91 container.style.width = shareDialog.TARGET_WIDTH + 'px'; |
| 92 container.style.height = shareDialog.TARGET_HEIGHT + 'px'; | 92 container.style.height = shareDialog.TARGET_HEIGHT + 'px'; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 /** | 95 /** |
|
mtomasz
2013/12/16 03:58:31
Change -> Changes
yoshiki
2013/12/16 04:29:01
Done.
| |
| 96 * Change the visibility of the dialog. | |
|
mtomasz
2013/12/16 03:58:31
Please add @param.
yoshiki
2013/12/16 04:29:01
Done.
| |
| 97 */ | |
| 98 shareDialog.setVisible = function(visible) { | |
| 99 shareDialog.sendMessage_('setVisible', {visible: visible}); | |
| 100 }; | |
| 101 | |
| 102 /** | |
| 96 * Prepares the embedder to make the contents visible. | 103 * Prepares the embedder to make the contents visible. |
| 97 */ | 104 */ |
| 98 shareDialog.prepareForVisible = function() { | 105 shareDialog.prepareForVisible = function() { |
| 99 shareDialog.sendMessage_('prepareForVisible'); | 106 shareDialog.sendMessage_('prepareForVisible'); |
| 100 }; | 107 }; |
| 101 | 108 |
| 102 /** | 109 /** |
| 103 * Resizes the embedder to the content window dimensions. | 110 * Resizes the embedder to the content window dimensions. |
| 104 */ | 111 */ |
| 105 shareDialog.resize = function() { | 112 shareDialog.resize = function() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 | 153 |
| 147 /** | 154 /** |
| 148 * Initializes the mocked share dialog. | 155 * Initializes the mocked share dialog. |
| 149 */ | 156 */ |
| 150 shareDialog.initialize = function() { | 157 shareDialog.initialize = function() { |
| 151 window.addEventListener('message', shareDialog.onMessage_); | 158 window.addEventListener('message', shareDialog.onMessage_); |
| 152 shareDialog.prepareForVisible(); | 159 shareDialog.prepareForVisible(); |
| 153 }; | 160 }; |
| 154 | 161 |
| 155 window.addEventListener('load', shareDialog.initialize); | 162 window.addEventListener('load', shareDialog.initialize); |
| OLD | NEW |