OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * This view displays options for captured data into a file. |
| 7 */ |
| 8 var MobileView = (function() { |
| 9 'use strict'; |
| 10 |
| 11 // We inherit from DivView. |
| 12 var superClass = DivView; |
| 13 |
| 14 /** |
| 15 * @constructor |
| 16 */ |
| 17 function MobileView() { |
| 18 assertFirstConstructorCall(MobileView); |
| 19 |
| 20 // Call superclass's constructor. |
| 21 superClass.call(this, MobileView.MAIN_BOX_ID); |
| 22 |
| 23 this.startDataButton_ = $(MobileView.START_DATA_BUTTON_ID); |
| 24 this.startDataButton_.onclick = this.onStartData_.bind(this); |
| 25 this.stopDataButton_ = $(MobileView.STOP_DATA_BUTTON_ID); |
| 26 this.stopDataButton_.onclick = this.onStopData_.bind(this); |
| 27 this.sendDataButton_ = $(MobileView.SEND_DATA_BUTTON_ID); |
| 28 this.sendDataButton_.onclick = this.onSendData_.bind(this); |
| 29 } |
| 30 |
| 31 // ID for special HTML element in category_tabs.html |
| 32 MobileView.TAB_HANDLE_ID = 'tab-handle-mobile'; |
| 33 |
| 34 // IDs for special HTML elements in mobile_view.html |
| 35 MobileView.MAIN_BOX_ID = 'mobile-view-tab-content'; |
| 36 MobileView.START_DATA_BUTTON_ID = 'mobile-view-start-data'; |
| 37 MobileView.STOP_DATA_BUTTON_ID = 'mobile-view-stop-data'; |
| 38 MobileView.SEND_DATA_BUTTON_ID = 'mobile-view-send-data'; |
| 39 |
| 40 cr.addSingletonGetter(MobileView); |
| 41 |
| 42 MobileView.prototype = { |
| 43 // Inherit the superclass's methods. |
| 44 __proto__: superClass.prototype, |
| 45 |
| 46 /** |
| 47 * Starts saving NetLog data to a file. |
| 48 */ |
| 49 onStartData_: function() { |
| 50 g_browser.sendStartNetLog(); |
| 51 g_browser.checkForUpdatedInfo(false); |
| 52 }, |
| 53 |
| 54 /** |
| 55 * Stops saving NetLog data to a file. |
| 56 */ |
| 57 onStopData_: function() { |
| 58 g_browser.sendStopNetLog(); |
| 59 g_browser.checkForUpdatedInfo(false); |
| 60 }, |
| 61 |
| 62 /** |
| 63 * Sends NetLog data via email from browser. |
| 64 */ |
| 65 onSendData_: function() { |
| 66 g_browser.sendSendNetLog(); |
| 67 g_browser.checkForUpdatedInfo(false); |
| 68 } |
| 69 |
| 70 }; |
| 71 |
| 72 return MobileView; |
| 73 })(); |
OLD | NEW |