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

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

Issue 1420053005: Move code in components/safe_browsing_db and chrome/browser/s_b/ under the safe_browsing namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_components_move
Patch Set: Remove '// namespace safe_browsing' for a small fwd decl block. Created 5 years, 1 month 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 <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 return; 554 return;
555 popup_helper->AddBlockedPopup(params); 555 popup_helper->AddBlockedPopup(params);
556 } 556 }
557 557
558 // An implementation of the SSLCertReporter interface used by 558 // An implementation of the SSLCertReporter interface used by
559 // SSLErrorHandler. Uses the SafeBrowsing UI manager to send invalid 559 // SSLErrorHandler. Uses the SafeBrowsing UI manager to send invalid
560 // certificate reports. 560 // certificate reports.
561 class SafeBrowsingSSLCertReporter : public SSLCertReporter { 561 class SafeBrowsingSSLCertReporter : public SSLCertReporter {
562 public: 562 public:
563 explicit SafeBrowsingSSLCertReporter( 563 explicit SafeBrowsingSSLCertReporter(
564 const scoped_refptr<SafeBrowsingUIManager>& safe_browsing_ui_manager) 564 const scoped_refptr<safe_browsing::SafeBrowsingUIManager>&
565 safe_browsing_ui_manager)
565 : safe_browsing_ui_manager_(safe_browsing_ui_manager) {} 566 : safe_browsing_ui_manager_(safe_browsing_ui_manager) {}
566 ~SafeBrowsingSSLCertReporter() override {} 567 ~SafeBrowsingSSLCertReporter() override {}
567 568
568 // SSLCertReporter implementation 569 // SSLCertReporter implementation
569 void ReportInvalidCertificateChain( 570 void ReportInvalidCertificateChain(
570 const std::string& serialized_report) override { 571 const std::string& serialized_report) override {
571 if (safe_browsing_ui_manager_) { 572 if (safe_browsing_ui_manager_) {
572 safe_browsing_ui_manager_->ReportInvalidCertificateChain( 573 safe_browsing_ui_manager_->ReportInvalidCertificateChain(
573 serialized_report, base::Bind(&base::DoNothing)); 574 serialized_report, base::Bind(&base::DoNothing));
574 } 575 }
575 } 576 }
576 577
577 private: 578 private:
578 const scoped_refptr<SafeBrowsingUIManager> safe_browsing_ui_manager_; 579 const scoped_refptr<safe_browsing::SafeBrowsingUIManager>
580 safe_browsing_ui_manager_;
579 }; 581 };
580 582
581 #if defined(OS_ANDROID) 583 #if defined(OS_ANDROID)
582 584
583 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) { 585 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) {
584 WebContents* web_contents = tab_util::GetWebContentsByFrameID( 586 WebContents* web_contents = tab_util::GetWebContentsByFrameID(
585 params.render_process_id(), params.opener_render_frame_id()); 587 params.render_process_id(), params.opener_render_frame_id());
586 if (!web_contents) 588 if (!web_contents)
587 return; 589 return;
588 590
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 // Otherwise, display an SSL blocking page. The interstitial page takes 1982 // Otherwise, display an SSL blocking page. The interstitial page takes
1981 // ownership of ssl_blocking_page. 1983 // ownership of ssl_blocking_page.
1982 int options_mask = 0; 1984 int options_mask = 0;
1983 if (overridable) 1985 if (overridable)
1984 options_mask |= SSLBlockingPage::OVERRIDABLE; 1986 options_mask |= SSLBlockingPage::OVERRIDABLE;
1985 if (strict_enforcement) 1987 if (strict_enforcement)
1986 options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT; 1988 options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT;
1987 if (expired_previous_decision) 1989 if (expired_previous_decision)
1988 options_mask |= SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED; 1990 options_mask |= SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED;
1989 1991
1990 SafeBrowsingService* safe_browsing_service = 1992 safe_browsing::SafeBrowsingService* safe_browsing_service =
1991 g_browser_process->safe_browsing_service(); 1993 g_browser_process->safe_browsing_service();
1992 scoped_ptr<SafeBrowsingSSLCertReporter> cert_reporter( 1994 scoped_ptr<SafeBrowsingSSLCertReporter> cert_reporter(
1993 new SafeBrowsingSSLCertReporter(safe_browsing_service 1995 new SafeBrowsingSSLCertReporter(safe_browsing_service
1994 ? safe_browsing_service->ui_manager() 1996 ? safe_browsing_service->ui_manager()
1995 : nullptr)); 1997 : nullptr));
1996 SSLErrorHandler::HandleSSLError(tab, cert_error, ssl_info, request_url, 1998 SSLErrorHandler::HandleSSLError(tab, cert_error, ssl_info, request_url,
1997 options_mask, cert_reporter.Pass(), callback); 1999 options_mask, cert_reporter.Pass(), callback);
1998 } 2000 }
1999 2001
2000 void ChromeContentBrowserClient::SelectClientCertificate( 2002 void ChromeContentBrowserClient::SelectClientCertificate(
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
2763 if (channel <= kMaxDisableEncryptionChannel) { 2765 if (channel <= kMaxDisableEncryptionChannel) {
2764 static const char* const kWebRtcDevSwitchNames[] = { 2766 static const char* const kWebRtcDevSwitchNames[] = {
2765 switches::kDisableWebRtcEncryption, 2767 switches::kDisableWebRtcEncryption,
2766 }; 2768 };
2767 to_command_line->CopySwitchesFrom(from_command_line, 2769 to_command_line->CopySwitchesFrom(from_command_line,
2768 kWebRtcDevSwitchNames, 2770 kWebRtcDevSwitchNames,
2769 arraysize(kWebRtcDevSwitchNames)); 2771 arraysize(kWebRtcDevSwitchNames));
2770 } 2772 }
2771 } 2773 }
2772 #endif // defined(ENABLE_WEBRTC) 2774 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698