OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_internals/net_internals_ui.h" | 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/base64.h" | 13 #include "base/base64.h" |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "base/file_util.h" | 17 #include "base/file_util.h" |
18 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "base/message_loop/message_loop.h" | 20 #include "base/message_loop/message_loop.h" |
21 #include "base/platform_file.h" | 21 #include "base/platform_file.h" |
22 #include "base/prefs/pref_member.h" | 22 #include "base/prefs/pref_member.h" |
23 #include "base/sequenced_task_runner_helpers.h" | 23 #include "base/sequenced_task_runner_helpers.h" |
24 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
25 #include "base/strings/string_piece.h" | 25 #include "base/strings/string_piece.h" |
26 #include "base/strings/string_split.h" | 26 #include "base/strings/string_split.h" |
27 #include "base/strings/string_util.h" | 27 #include "base/strings/string_util.h" |
28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| 29 #include "base/task/cancelable_task_tracker.h" |
29 #include "base/threading/worker_pool.h" | 30 #include "base/threading/worker_pool.h" |
30 #include "base/values.h" | 31 #include "base/values.h" |
31 #include "chrome/browser/browser_process.h" | 32 #include "chrome/browser/browser_process.h" |
32 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 33 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
33 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 34 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
34 #include "chrome/browser/chrome_notification_types.h" | 35 #include "chrome/browser/chrome_notification_types.h" |
35 #include "chrome/browser/download/download_prefs.h" | 36 #include "chrome/browser/download/download_prefs.h" |
36 #include "chrome/browser/extensions/extension_service.h" | 37 #include "chrome/browser/extensions/extension_service.h" |
37 #include "chrome/browser/io_thread.h" | 38 #include "chrome/browser/io_thread.h" |
38 #include "chrome/browser/net/chrome_net_log.h" | 39 #include "chrome/browser/net/chrome_net_log.h" |
39 #include "chrome/browser/net/chrome_network_delegate.h" | 40 #include "chrome/browser/net/chrome_network_delegate.h" |
40 #include "chrome/browser/net/connection_tester.h" | 41 #include "chrome/browser/net/connection_tester.h" |
41 #include "chrome/browser/prerender/prerender_manager.h" | 42 #include "chrome/browser/prerender/prerender_manager.h" |
42 #include "chrome/browser/prerender/prerender_manager_factory.h" | 43 #include "chrome/browser/prerender/prerender_manager_factory.h" |
43 #include "chrome/browser/profiles/profile.h" | 44 #include "chrome/browser/profiles/profile.h" |
44 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" | 45 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" |
45 #include "chrome/common/cancelable_task_tracker.h" | |
46 #include "chrome/common/chrome_paths.h" | 46 #include "chrome/common/chrome_paths.h" |
47 #include "chrome/common/chrome_version_info.h" | 47 #include "chrome/common/chrome_version_info.h" |
48 #include "chrome/common/logging_chrome.h" | 48 #include "chrome/common/logging_chrome.h" |
49 #include "chrome/common/net/url_fixer_upper.h" | 49 #include "chrome/common/net/url_fixer_upper.h" |
50 #include "chrome/common/pref_names.h" | 50 #include "chrome/common/pref_names.h" |
51 #include "chrome/common/url_constants.h" | 51 #include "chrome/common/url_constants.h" |
52 #include "components/onc/onc_constants.h" | 52 #include "components/onc/onc_constants.h" |
53 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
54 #include "content/public/browser/notification_details.h" | 54 #include "content/public/browser/notification_details.h" |
55 #include "content/public/browser/resource_dispatcher_host.h" | 55 #include "content/public/browser/resource_dispatcher_host.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // Processes request. | 436 // Processes request. |
437 void SendLogs(const SystemLogRequest& request); | 437 void SendLogs(const SystemLogRequest& request); |
438 | 438 |
439 NetInternalsMessageHandler* handler_; | 439 NetInternalsMessageHandler* handler_; |
440 chromeos::system::SyslogsProvider* syslogs_provider_; | 440 chromeos::system::SyslogsProvider* syslogs_provider_; |
441 // List of postponed requests. | 441 // List of postponed requests. |
442 std::list<SystemLogRequest> requests_; | 442 std::list<SystemLogRequest> requests_; |
443 scoped_ptr<chromeos::system::LogDictionaryType> logs_; | 443 scoped_ptr<chromeos::system::LogDictionaryType> logs_; |
444 bool logs_received_; | 444 bool logs_received_; |
445 bool logs_requested_; | 445 bool logs_requested_; |
446 CancelableTaskTracker tracker_; | 446 base::CancelableTaskTracker tracker_; |
447 // Libcros request task ID. | 447 // Libcros request task ID. |
448 CancelableTaskTracker::TaskId syslogs_task_id_; | 448 base::CancelableTaskTracker::TaskId syslogs_task_id_; |
449 }; | 449 }; |
450 #endif // defined(OS_CHROMEOS) | 450 #endif // defined(OS_CHROMEOS) |
451 | 451 |
452 // This is the "real" message handler, which lives on the IO thread. | 452 // This is the "real" message handler, which lives on the IO thread. |
453 scoped_refptr<IOThreadImpl> proxy_; | 453 scoped_refptr<IOThreadImpl> proxy_; |
454 | 454 |
455 base::WeakPtr<prerender::PrerenderManager> prerender_manager_; | 455 base::WeakPtr<prerender::PrerenderManager> prerender_manager_; |
456 | 456 |
457 #if defined(OS_CHROMEOS) | 457 #if defined(OS_CHROMEOS) |
458 // Class that handles getting and filtering system logs. | 458 // Class that handles getting and filtering system logs. |
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1849 } | 1849 } |
1850 | 1850 |
1851 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1851 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1852 : WebUIController(web_ui) { | 1852 : WebUIController(web_ui) { |
1853 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1853 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1854 | 1854 |
1855 // Set up the chrome://net-internals/ source. | 1855 // Set up the chrome://net-internals/ source. |
1856 Profile* profile = Profile::FromWebUI(web_ui); | 1856 Profile* profile = Profile::FromWebUI(web_ui); |
1857 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1857 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1858 } | 1858 } |
OLD | NEW |