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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_tab_observer.cc

Issue 1081403002: Refactor safe-browsing build-config definitions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again to fix collision Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_tab_observer.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_tab_observer.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_tab_observer.cc b/chrome/browser/safe_browsing/safe_browsing_tab_observer.cc
index a34c06cbcbbcef02f4afbbce7934529669283f55..00df92ed09b3964283186d4c6d0b0b2f268b3bbf 100644
--- a/chrome/browser/safe_browsing/safe_browsing_tab_observer.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_tab_observer.cc
@@ -15,7 +15,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
-#if defined(FULL_SAFE_BROWSING)
+#if defined(SAFE_BROWSING_CSD)
#include "chrome/browser/safe_browsing/client_side_detection_host.h"
#endif
@@ -23,16 +23,17 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(safe_browsing::SafeBrowsingTabObserver);
namespace safe_browsing {
-#if !defined(FULL_SAFE_BROWSING)
+#if !defined(SAFE_BROWSING_CSD)
// Provide a dummy implementation so that scoped_ptr<ClientSideDetectionHost>
// has a concrete destructor to call. This is necessary because it is used
// as a member of SafeBrowsingTabObserver, even if it only ever contains NULL.
+// TODO(shess): This is weird, why not just guard the instance variable?
class ClientSideDetectionHost { };
#endif
SafeBrowsingTabObserver::SafeBrowsingTabObserver(
content::WebContents* web_contents) : web_contents_(web_contents) {
-#if defined(FULL_SAFE_BROWSING)
+#if defined(SAFE_BROWSING_CSD)
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
@@ -59,7 +60,7 @@ SafeBrowsingTabObserver::~SafeBrowsingTabObserver() {
// Internal helpers
void SafeBrowsingTabObserver::UpdateSafebrowsingDetectionHost() {
-#if defined(FULL_SAFE_BROWSING)
+#if defined(SAFE_BROWSING_CSD)
Profile* profile =
Profile::FromBrowserContext(web_contents_->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
@@ -80,9 +81,8 @@ void SafeBrowsingTabObserver::UpdateSafebrowsingDetectionHost() {
#endif
}
- // Forwards to detection host is client-side detection is enabled.
bool SafeBrowsingTabObserver::DidPageReceiveSafeBrowsingMatch() const {
-#if defined(FULL_SAFE_BROWSING)
+#if defined(SAFE_BROWSING_CSD)
return safebrowsing_detection_host_ &&
safebrowsing_detection_host_->DidPageReceiveSafeBrowsingMatch();
#else
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_tab_observer.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698