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

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

Issue 542253003: Add a global on/off switch for content settings and expose a toggle on the Website Settings options… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@global-settings
Patch Set: Rebase. Created 6 years, 3 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/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 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 prerender::FINAL_STATUS_SSL_CLIENT_CERTIFICATE_REQUESTED); 1743 prerender::FINAL_STATUS_SSL_CLIENT_CERTIFICATE_REQUESTED);
1744 return; 1744 return;
1745 } 1745 }
1746 1746
1747 GURL requesting_url("https://" + cert_request_info->host_and_port.ToString()); 1747 GURL requesting_url("https://" + cert_request_info->host_and_port.ToString());
1748 DCHECK(requesting_url.is_valid()) 1748 DCHECK(requesting_url.is_valid())
1749 << "Invalid URL string: https://" 1749 << "Invalid URL string: https://"
1750 << cert_request_info->host_and_port.ToString(); 1750 << cert_request_info->host_and_port.ToString();
1751 1751
1752 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext()); 1752 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
1753 scoped_ptr<base::Value> filter( 1753 scoped_ptr<base::Value> filter =
1754 profile->GetHostContentSettingsMap()->GetWebsiteSetting( 1754 profile->GetHostContentSettingsMap()->GetWebsiteSetting(
1755 requesting_url, 1755 requesting_url,
1756 requesting_url, 1756 requesting_url,
1757 CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, 1757 CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
1758 std::string(), NULL)); 1758 std::string(),
1759 NULL);
1759 1760
1760 if (filter.get()) { 1761 if (filter.get()) {
1761 // Try to automatically select a client certificate. 1762 // Try to automatically select a client certificate.
1762 if (filter->IsType(base::Value::TYPE_DICTIONARY)) { 1763 if (filter->IsType(base::Value::TYPE_DICTIONARY)) {
1763 base::DictionaryValue* filter_dict = 1764 base::DictionaryValue* filter_dict =
1764 static_cast<base::DictionaryValue*>(filter.get()); 1765 static_cast<base::DictionaryValue*>(filter.get());
1765 1766
1766 const std::vector<scoped_refptr<net::X509Certificate> >& 1767 const std::vector<scoped_refptr<net::X509Certificate> >&
1767 all_client_certs = cert_request_info->client_certs; 1768 all_client_certs = cert_request_info->client_certs;
1768 for (size_t i = 0; i < all_client_certs.size(); ++i) { 1769 for (size_t i = 0; i < all_client_certs.size(); ++i) {
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
2592 switches::kDisableWebRtcEncryption, 2593 switches::kDisableWebRtcEncryption,
2593 }; 2594 };
2594 to_command_line->CopySwitchesFrom(from_command_line, 2595 to_command_line->CopySwitchesFrom(from_command_line,
2595 kWebRtcDevSwitchNames, 2596 kWebRtcDevSwitchNames,
2596 arraysize(kWebRtcDevSwitchNames)); 2597 arraysize(kWebRtcDevSwitchNames));
2597 } 2598 }
2598 } 2599 }
2599 #endif // defined(ENABLE_WEBRTC) 2600 #endif // defined(ENABLE_WEBRTC)
2600 2601
2601 } // namespace chrome 2602 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698