| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/ui/webui/net_export_ui.h" | 5 #include "chrome/browser/ui/webui/net_export_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // this class's public methods are expected to run on the UI thread. All static | 49 // this class's public methods are expected to run on the UI thread. All static |
| 50 // functions except SendEmail run on FILE_USER_BLOCKING thread. | 50 // functions except SendEmail run on FILE_USER_BLOCKING thread. |
| 51 class NetExportMessageHandler | 51 class NetExportMessageHandler |
| 52 : public WebUIMessageHandler, | 52 : public WebUIMessageHandler, |
| 53 public base::SupportsWeakPtr<NetExportMessageHandler> { | 53 public base::SupportsWeakPtr<NetExportMessageHandler> { |
| 54 public: | 54 public: |
| 55 NetExportMessageHandler(); | 55 NetExportMessageHandler(); |
| 56 virtual ~NetExportMessageHandler(); | 56 virtual ~NetExportMessageHandler(); |
| 57 | 57 |
| 58 // WebUIMessageHandler implementation. | 58 // WebUIMessageHandler implementation. |
| 59 virtual void RegisterMessages() OVERRIDE; | 59 virtual void RegisterMessages() override; |
| 60 | 60 |
| 61 // Messages. | 61 // Messages. |
| 62 void OnGetExportNetLogInfo(const base::ListValue* list); | 62 void OnGetExportNetLogInfo(const base::ListValue* list); |
| 63 void OnStartNetLog(const base::ListValue* list); | 63 void OnStartNetLog(const base::ListValue* list); |
| 64 void OnStopNetLog(const base::ListValue* list); | 64 void OnStopNetLog(const base::ListValue* list); |
| 65 void OnSendNetLog(const base::ListValue* list); | 65 void OnSendNetLog(const base::ListValue* list); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 // Calls NetLogTempFile's ProcessCommand with DO_START and DO_STOP commands. | 68 // Calls NetLogTempFile's ProcessCommand with DO_START and DO_STOP commands. |
| 69 static void ProcessNetLogCommand( | 69 static void ProcessNetLogCommand( |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 } // namespace | 244 } // namespace |
| 245 | 245 |
| 246 NetExportUI::NetExportUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 246 NetExportUI::NetExportUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 247 web_ui->AddMessageHandler(new NetExportMessageHandler()); | 247 web_ui->AddMessageHandler(new NetExportMessageHandler()); |
| 248 | 248 |
| 249 // Set up the chrome://net-export/ source. | 249 // Set up the chrome://net-export/ source. |
| 250 Profile* profile = Profile::FromWebUI(web_ui); | 250 Profile* profile = Profile::FromWebUI(web_ui); |
| 251 content::WebUIDataSource::Add(profile, CreateNetExportHTMLSource()); | 251 content::WebUIDataSource::Add(profile, CreateNetExportHTMLSource()); |
| 252 } | 252 } |
| OLD | NEW |