Index: chrome/browser/resources/net_internals/mobile_view.js |
=================================================================== |
--- chrome/browser/resources/net_internals/mobile_view.js (revision 0) |
+++ chrome/browser/resources/net_internals/mobile_view.js (working copy) |
@@ -0,0 +1,73 @@ |
+// 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. |
+ |
+/** |
+ * This view displays options for captured data into a file. |
+ */ |
+var MobileView = (function() { |
+ 'use strict'; |
+ |
+ // We inherit from DivView. |
+ var superClass = DivView; |
+ |
+ /** |
+ * @constructor |
+ */ |
+ function MobileView() { |
+ assertFirstConstructorCall(MobileView); |
+ |
+ // Call superclass's constructor. |
+ superClass.call(this, MobileView.MAIN_BOX_ID); |
+ |
+ this.startDataButton_ = $(MobileView.START_DATA_BUTTON_ID); |
+ this.startDataButton_.onclick = this.onStartData_.bind(this); |
+ this.stopDataButton_ = $(MobileView.STOP_DATA_BUTTON_ID); |
+ this.stopDataButton_.onclick = this.onStopData_.bind(this); |
+ this.sendDataButton_ = $(MobileView.SEND_DATA_BUTTON_ID); |
+ this.sendDataButton_.onclick = this.onSendData_.bind(this); |
+ } |
+ |
+ // ID for special HTML element in category_tabs.html |
+ MobileView.TAB_HANDLE_ID = 'tab-handle-mobile'; |
+ |
+ // IDs for special HTML elements in mobile_view.html |
+ MobileView.MAIN_BOX_ID = 'mobile-view-tab-content'; |
+ MobileView.START_DATA_BUTTON_ID = 'mobile-view-start-data'; |
+ MobileView.STOP_DATA_BUTTON_ID = 'mobile-view-stop-data'; |
+ MobileView.SEND_DATA_BUTTON_ID = 'mobile-view-send-data'; |
+ |
+ cr.addSingletonGetter(MobileView); |
+ |
+ MobileView.prototype = { |
+ // Inherit the superclass's methods. |
+ __proto__: superClass.prototype, |
+ |
+ /** |
+ * Starts saving NetLog data to a file. |
+ */ |
+ onStartData_: function() { |
+ g_browser.sendStartNetLog(); |
+ g_browser.checkForUpdatedInfo(false); |
+ }, |
+ |
+ /** |
+ * Stops saving NetLog data to a file. |
+ */ |
+ onStopData_: function() { |
+ g_browser.sendStopNetLog(); |
+ g_browser.checkForUpdatedInfo(false); |
+ }, |
+ |
+ /** |
+ * Sends NetLog data via email from browser. |
+ */ |
+ onSendData_: function() { |
+ g_browser.sendSendNetLog(); |
+ g_browser.checkForUpdatedInfo(false); |
+ } |
+ |
+ }; |
+ |
+ return MobileView; |
+})(); |
Property changes on: chrome/browser/resources/net_internals/mobile_view.js |
___________________________________________________________________ |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |