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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments, added unit tests Created 6 years, 8 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 | Annotate | Revision Log
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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "chrome/browser/browsing_data/browsing_data_helper.h" 24 #include "chrome/browser/browsing_data/browsing_data_helper.h"
25 #include "chrome/browser/browsing_data/browsing_data_remover.h" 25 #include "chrome/browser/browsing_data/browsing_data_remover.h"
26 #include "chrome/browser/character_encoding.h" 26 #include "chrome/browser/character_encoding.h"
27 #include "chrome/browser/chrome_net_benchmarking_message_filter.h" 27 #include "chrome/browser/chrome_net_benchmarking_message_filter.h"
28 #include "chrome/browser/chrome_quota_permission_context.h" 28 #include "chrome/browser/chrome_quota_permission_context.h"
29 #include "chrome/browser/content_settings/content_settings_utils.h" 29 #include "chrome/browser/content_settings/content_settings_utils.h"
30 #include "chrome/browser/content_settings/cookie_settings.h" 30 #include "chrome/browser/content_settings/cookie_settings.h"
31 #include "chrome/browser/content_settings/host_content_settings_map.h" 31 #include "chrome/browser/content_settings/host_content_settings_map.h"
32 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 32 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
33 #include "chrome/browser/defaults.h" 33 #include "chrome/browser/defaults.h"
34 #include "chrome/browser/devtools/devtools_network_controller.h"
34 #include "chrome/browser/download/download_prefs.h" 35 #include "chrome/browser/download/download_prefs.h"
35 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 36 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
36 #include "chrome/browser/extensions/browser_permissions_policy_delegate.h" 37 #include "chrome/browser/extensions/browser_permissions_policy_delegate.h"
37 #include "chrome/browser/extensions/extension_service.h" 38 #include "chrome/browser/extensions/extension_service.h"
38 #include "chrome/browser/extensions/extension_util.h" 39 #include "chrome/browser/extensions/extension_util.h"
39 #include "chrome/browser/extensions/extension_web_ui.h" 40 #include "chrome/browser/extensions/extension_web_ui.h"
40 #include "chrome/browser/extensions/extension_webkit_preferences.h" 41 #include "chrome/browser/extensions/extension_webkit_preferences.h"
41 #include "chrome/browser/extensions/suggest_permission_util.h" 42 #include "chrome/browser/extensions/suggest_permission_util.h"
42 #include "chrome/browser/geolocation/chrome_access_token_store.h" 43 #include "chrome/browser/geolocation/chrome_access_token_store.h"
43 #include "chrome/browser/google/google_util.h" 44 #include "chrome/browser/google/google_util.h"
(...skipping 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after
2415 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) { 2416 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) {
2416 Profile* profile = Profile::FromBrowserContext( 2417 Profile* profile = Profile::FromBrowserContext(
2417 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); 2418 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext());
2418 BrowsingDataRemover* remover = 2419 BrowsingDataRemover* remover =
2419 BrowsingDataRemover::CreateForUnboundedRange(profile); 2420 BrowsingDataRemover::CreateForUnboundedRange(profile);
2420 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA; 2421 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA;
2421 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); 2422 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB);
2422 // BrowsingDataRemover takes care of deleting itself when done. 2423 // BrowsingDataRemover takes care of deleting itself when done.
2423 } 2424 }
2424 2425
2426 void ChromeContentBrowserClient::DisableNetwork(
2427 content::RenderViewHost* rvh,
2428 const std::string& id,
2429 bool disable_network) {
2430 Profile* profile = Profile::FromBrowserContext(
2431 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext());
2432 DevToolsNetworkController::DisableNetwork(profile, id, disable_network);
2433 }
2434
2425 base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { 2435 base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
2426 return DownloadPrefs::GetDefaultDownloadDirectory(); 2436 return DownloadPrefs::GetDefaultDownloadDirectory();
2427 } 2437 }
2428 2438
2429 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { 2439 std::string ChromeContentBrowserClient::GetDefaultDownloadName() {
2430 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); 2440 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME);
2431 } 2441 }
2432 2442
2433 void ChromeContentBrowserClient::DidCreatePpapiPlugin( 2443 void ChromeContentBrowserClient::DidCreatePpapiPlugin(
2434 content::BrowserPpapiHost* browser_host) { 2444 content::BrowserPpapiHost* browser_host) {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
2715 switches::kDisableWebRtcEncryption, 2725 switches::kDisableWebRtcEncryption,
2716 }; 2726 };
2717 to_command_line->CopySwitchesFrom(from_command_line, 2727 to_command_line->CopySwitchesFrom(from_command_line,
2718 kWebRtcDevSwitchNames, 2728 kWebRtcDevSwitchNames,
2719 arraysize(kWebRtcDevSwitchNames)); 2729 arraysize(kWebRtcDevSwitchNames));
2720 } 2730 }
2721 } 2731 }
2722 #endif // defined(ENABLE_WEBRTC) 2732 #endif // defined(ENABLE_WEBRTC)
2723 2733
2724 } // namespace chrome 2734 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698