Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(735)

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 2733393003: Split browsing data masks between content and embedder (Closed)
Patch Set: Rebase (merged automatically) Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
(...skipping 17 matching lines...) Expand all
28 #include "base/strings/string_piece.h" 28 #include "base/strings/string_piece.h"
29 #include "base/strings/string_split.h" 29 #include "base/strings/string_split.h"
30 #include "base/strings/string_util.h" 30 #include "base/strings/string_util.h"
31 #include "base/strings/utf_string_conversions.h" 31 #include "base/strings/utf_string_conversions.h"
32 #include "base/values.h" 32 #include "base/values.h"
33 #include "build/build_config.h" 33 #include "build/build_config.h"
34 #include "chrome/browser/browser_process.h" 34 #include "chrome/browser/browser_process.h"
35 #include "chrome/browser/browsing_data/browsing_data_helper.h" 35 #include "chrome/browser/browsing_data/browsing_data_helper.h"
36 #include "chrome/browser/browsing_data/browsing_data_remover.h" 36 #include "chrome/browser/browsing_data/browsing_data_remover.h"
37 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" 37 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h"
38 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
38 #include "chrome/browser/chrome_notification_types.h" 39 #include "chrome/browser/chrome_notification_types.h"
39 #include "chrome/browser/download/download_prefs.h" 40 #include "chrome/browser/download/download_prefs.h"
40 #include "chrome/browser/io_thread.h" 41 #include "chrome/browser/io_thread.h"
41 #include "chrome/browser/net/chrome_network_delegate.h" 42 #include "chrome/browser/net/chrome_network_delegate.h"
42 #include "chrome/browser/net/net_export_helper.h" 43 #include "chrome/browser/net/net_export_helper.h"
43 #include "chrome/browser/profiles/profile.h" 44 #include "chrome/browser/profiles/profile.h"
44 #include "chrome/common/channel_info.h" 45 #include "chrome/common/channel_info.h"
45 #include "chrome/common/chrome_paths.h" 46 #include "chrome/common/chrome_paths.h"
46 #include "chrome/common/url_constants.h" 47 #include "chrome/common/url_constants.h"
47 #include "chrome/grit/net_internals_resources.h" 48 #include "chrome/grit/net_internals_resources.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 void NetInternalsMessageHandler::OnRendererReady(const base::ListValue* list) { 499 void NetInternalsMessageHandler::OnRendererReady(const base::ListValue* list) {
499 IOThreadImpl::CallbackHelper(&IOThreadImpl::OnRendererReady, proxy_, list); 500 IOThreadImpl::CallbackHelper(&IOThreadImpl::OnRendererReady, proxy_, list);
500 } 501 }
501 502
502 void NetInternalsMessageHandler::OnClearBrowserCache( 503 void NetInternalsMessageHandler::OnClearBrowserCache(
503 const base::ListValue* list) { 504 const base::ListValue* list) {
504 BrowsingDataRemover* remover = 505 BrowsingDataRemover* remover =
505 BrowsingDataRemoverFactory::GetForBrowserContext( 506 BrowsingDataRemoverFactory::GetForBrowserContext(
506 Profile::FromWebUI(web_ui())); 507 Profile::FromWebUI(web_ui()));
507 remover->Remove(base::Time(), base::Time::Max(), 508 remover->Remove(base::Time(), base::Time::Max(),
508 BrowsingDataRemover::REMOVE_CACHE, 509 BrowsingDataRemover::DATA_TYPE_CACHE,
509 BrowsingDataHelper::UNPROTECTED_WEB); 510 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB);
510 // BrowsingDataRemover deletes itself. 511 // BrowsingDataRemover deletes itself.
511 } 512 }
512 513
513 void NetInternalsMessageHandler::OnGetPrerenderInfo( 514 void NetInternalsMessageHandler::OnGetPrerenderInfo(
514 const base::ListValue* list) { 515 const base::ListValue* list) {
515 DCHECK_CURRENTLY_ON(BrowserThread::UI); 516 DCHECK_CURRENTLY_ON(BrowserThread::UI);
516 SendJavascriptCommand( 517 SendJavascriptCommand(
517 "receivedPrerenderInfo", 518 "receivedPrerenderInfo",
518 chrome_browser_net::GetPrerenderInfo(Profile::FromWebUI(web_ui()))); 519 chrome_browser_net::GetPrerenderInfo(Profile::FromWebUI(web_ui())));
519 } 520 }
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 //////////////////////////////////////////////////////////////////////////////// 1055 ////////////////////////////////////////////////////////////////////////////////
1055 1056
1056 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1057 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1057 : WebUIController(web_ui) { 1058 : WebUIController(web_ui) {
1058 web_ui->AddMessageHandler(base::MakeUnique<NetInternalsMessageHandler>()); 1059 web_ui->AddMessageHandler(base::MakeUnique<NetInternalsMessageHandler>());
1059 1060
1060 // Set up the chrome://net-internals/ source. 1061 // Set up the chrome://net-internals/ source.
1061 Profile* profile = Profile::FromWebUI(web_ui); 1062 Profile* profile = Profile::FromWebUI(web_ui);
1062 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1063 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1063 } 1064 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/webui/options/clear_browser_data_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698