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

Side by Side Diff: chrome/browser/extensions/blacklist.cc

Issue 1081403002: Refactor safe-browsing build-config definitions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename INTERNAL/EXTERNAL to LOCAL/REMOTE 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/extensions/blacklist.h" 5 #include "chrome/browser/extensions/blacklist.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 16 matching lines...) Expand all
27 namespace extensions { 27 namespace extensions {
28 28
29 namespace { 29 namespace {
30 30
31 // The safe browsing database manager to use. Make this a global/static variable 31 // The safe browsing database manager to use. Make this a global/static variable
32 // rather than a member of Blacklist because Blacklist accesses the real 32 // rather than a member of Blacklist because Blacklist accesses the real
33 // database manager before it has a chance to get a fake one. 33 // database manager before it has a chance to get a fake one.
34 class LazySafeBrowsingDatabaseManager { 34 class LazySafeBrowsingDatabaseManager {
35 public: 35 public:
36 LazySafeBrowsingDatabaseManager() { 36 LazySafeBrowsingDatabaseManager() {
37 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) 37 #if defined(SAFE_BROWSING_DB_LOCAL)
38 if (g_browser_process && g_browser_process->safe_browsing_service()) { 38 if (g_browser_process && g_browser_process->safe_browsing_service()) {
39 instance_ = 39 instance_ =
40 g_browser_process->safe_browsing_service()->database_manager(); 40 g_browser_process->safe_browsing_service()->database_manager();
41 } 41 }
42 #endif 42 #endif
43 } 43 }
44 44
45 scoped_refptr<SafeBrowsingDatabaseManager> get() { 45 scoped_refptr<SafeBrowsingDatabaseManager> get() {
46 return instance_; 46 return instance_;
47 } 47 }
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 348
349 void Blacklist::Observe(int type, 349 void Blacklist::Observe(int type,
350 const content::NotificationSource& source, 350 const content::NotificationSource& source,
351 const content::NotificationDetails& details) { 351 const content::NotificationDetails& details) {
352 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); 352 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type);
353 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); 353 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated());
354 } 354 }
355 355
356 } // namespace extensions 356 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698