| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> |
| 11 #include <string> | 12 #include <string> |
| 12 #include <utility> | 13 #include <utility> |
| 13 #include <vector> | 14 #include <vector> |
| 14 | 15 |
| 15 #include "base/base64.h" | 16 #include "base/base64.h" |
| 16 #include "base/bind.h" | 17 #include "base/bind.h" |
| 17 #include "base/bind_helpers.h" | 18 #include "base/bind_helpers.h" |
| 18 #include "base/command_line.h" | 19 #include "base/command_line.h" |
| 19 #include "base/files/file.h" | 20 #include "base/files/file.h" |
| 20 #include "base/files/file_path.h" | 21 #include "base/files/file_path.h" |
| 21 #include "base/files/file_util.h" | 22 #include "base/files/file_util.h" |
| 22 #include "base/macros.h" | 23 #include "base/macros.h" |
| 23 #include "base/memory/ptr_util.h" | 24 #include "base/memory/ptr_util.h" |
| 24 #include "base/memory/weak_ptr.h" | 25 #include "base/memory/weak_ptr.h" |
| 25 #include "base/message_loop/message_loop.h" | 26 #include "base/message_loop/message_loop.h" |
| 26 #include "base/sequenced_task_runner_helpers.h" | 27 #include "base/sequenced_task_runner_helpers.h" |
| 27 #include "base/strings/string_number_conversions.h" | 28 #include "base/strings/string_number_conversions.h" |
| 28 #include "base/strings/string_piece.h" | 29 #include "base/strings/string_piece.h" |
| 29 #include "base/strings/string_split.h" | 30 #include "base/strings/string_split.h" |
| 30 #include "base/strings/string_util.h" | 31 #include "base/strings/string_util.h" |
| 31 #include "base/strings/utf_string_conversions.h" | 32 #include "base/strings/utf_string_conversions.h" |
| 32 #include "base/values.h" | 33 #include "base/values.h" |
| 33 #include "build/build_config.h" | 34 #include "build/build_config.h" |
| 34 #include "chrome/browser/browser_process.h" | 35 #include "chrome/browser/browser_process.h" |
| 35 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 36 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 36 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 37 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 37 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 38 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
| 39 #include "chrome/browser/browsing_data/chrome_browsing_data_types.h" |
| 38 #include "chrome/browser/chrome_notification_types.h" | 40 #include "chrome/browser/chrome_notification_types.h" |
| 39 #include "chrome/browser/download/download_prefs.h" | 41 #include "chrome/browser/download/download_prefs.h" |
| 40 #include "chrome/browser/io_thread.h" | 42 #include "chrome/browser/io_thread.h" |
| 41 #include "chrome/browser/net/chrome_network_delegate.h" | 43 #include "chrome/browser/net/chrome_network_delegate.h" |
| 42 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 44 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 43 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 45 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
| 44 #include "chrome/browser/prerender/prerender_manager.h" | 46 #include "chrome/browser/prerender/prerender_manager.h" |
| 45 #include "chrome/browser/prerender/prerender_manager_factory.h" | 47 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 46 #include "chrome/browser/profiles/profile.h" | 48 #include "chrome/browser/profiles/profile.h" |
| 47 #include "chrome/common/channel_info.h" | 49 #include "chrome/common/channel_info.h" |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 void NetInternalsMessageHandler::OnRendererReady(const base::ListValue* list) { | 520 void NetInternalsMessageHandler::OnRendererReady(const base::ListValue* list) { |
| 519 IOThreadImpl::CallbackHelper(&IOThreadImpl::OnRendererReady, proxy_, list); | 521 IOThreadImpl::CallbackHelper(&IOThreadImpl::OnRendererReady, proxy_, list); |
| 520 } | 522 } |
| 521 | 523 |
| 522 void NetInternalsMessageHandler::OnClearBrowserCache( | 524 void NetInternalsMessageHandler::OnClearBrowserCache( |
| 523 const base::ListValue* list) { | 525 const base::ListValue* list) { |
| 524 BrowsingDataRemover* remover = | 526 BrowsingDataRemover* remover = |
| 525 BrowsingDataRemoverFactory::GetForBrowserContext( | 527 BrowsingDataRemoverFactory::GetForBrowserContext( |
| 526 Profile::FromWebUI(web_ui())); | 528 Profile::FromWebUI(web_ui())); |
| 527 remover->Remove(base::Time(), base::Time::Max(), | 529 remover->Remove(base::Time(), base::Time::Max(), |
| 528 BrowsingDataRemover::REMOVE_CACHE, | 530 { &kBrowsingDataTypeCache }, |
| 529 BrowsingDataHelper::UNPROTECTED_WEB); | 531 BrowsingDataHelper::UNPROTECTED_WEB); |
| 530 // BrowsingDataRemover deletes itself. | 532 // BrowsingDataRemover deletes itself. |
| 531 } | 533 } |
| 532 | 534 |
| 533 void NetInternalsMessageHandler::OnGetPrerenderInfo( | 535 void NetInternalsMessageHandler::OnGetPrerenderInfo( |
| 534 const base::ListValue* /* list */) { | 536 const base::ListValue* /* list */) { |
| 535 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 537 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 536 | 538 |
| 537 std::unique_ptr<base::DictionaryValue> value; | 539 std::unique_ptr<base::DictionaryValue> value; |
| 538 | 540 |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 //////////////////////////////////////////////////////////////////////////////// | 1171 //////////////////////////////////////////////////////////////////////////////// |
| 1170 | 1172 |
| 1171 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1173 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
| 1172 : WebUIController(web_ui) { | 1174 : WebUIController(web_ui) { |
| 1173 web_ui->AddMessageHandler(base::MakeUnique<NetInternalsMessageHandler>()); | 1175 web_ui->AddMessageHandler(base::MakeUnique<NetInternalsMessageHandler>()); |
| 1174 | 1176 |
| 1175 // Set up the chrome://net-internals/ source. | 1177 // Set up the chrome://net-internals/ source. |
| 1176 Profile* profile = Profile::FromWebUI(web_ui); | 1178 Profile* profile = Profile::FromWebUI(web_ui); |
| 1177 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1179 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
| 1178 } | 1180 } |
| OLD | NEW |