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

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

Issue 119963004: Manage all the testing classes for Blacklist in TestBlacklist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 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
« no previous file with comments | « chrome/browser/extensions/blacklist.h ('k') | chrome/browser/extensions/blacklist_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 ++requests_it; 310 ++requests_it;
311 } 311 }
312 } 312 }
313 } 313 }
314 314
315 void Blacklist::SetBlacklistStateFetcherForTest( 315 void Blacklist::SetBlacklistStateFetcherForTest(
316 BlacklistStateFetcher* fetcher) { 316 BlacklistStateFetcher* fetcher) {
317 state_fetcher_.reset(fetcher); 317 state_fetcher_.reset(fetcher);
318 } 318 }
319 319
320 BlacklistStateFetcher* Blacklist::ResetBlacklistStateFetcherForTest() {
321 return state_fetcher_.release();
322 }
323
320 void Blacklist::AddObserver(Observer* observer) { 324 void Blacklist::AddObserver(Observer* observer) {
321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 325 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
322 observers_.AddObserver(observer); 326 observers_.AddObserver(observer);
323 } 327 }
324 328
325 void Blacklist::RemoveObserver(Observer* observer) { 329 void Blacklist::RemoveObserver(Observer* observer) {
326 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 330 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
327 observers_.RemoveObserver(observer); 331 observers_.RemoveObserver(observer);
328 } 332 }
329 333
330 // static 334 // static
331 void Blacklist::SetDatabaseManager( 335 void Blacklist::SetDatabaseManager(
332 scoped_refptr<SafeBrowsingDatabaseManager> database_manager) { 336 scoped_refptr<SafeBrowsingDatabaseManager> database_manager) {
333 g_database_manager.Get().set(database_manager); 337 g_database_manager.Get().set(database_manager);
334 } 338 }
335 339
336 // static 340 // static
337 scoped_refptr<SafeBrowsingDatabaseManager> Blacklist::GetDatabaseManager() { 341 scoped_refptr<SafeBrowsingDatabaseManager> Blacklist::GetDatabaseManager() {
338 return g_database_manager.Get().get(); 342 return g_database_manager.Get().get();
339 } 343 }
340 344
341 void Blacklist::Observe(int type, 345 void Blacklist::Observe(int type,
342 const content::NotificationSource& source, 346 const content::NotificationSource& source,
343 const content::NotificationDetails& details) { 347 const content::NotificationDetails& details) {
344 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); 348 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type);
345 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); 349 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated());
346 } 350 }
347 351
348 } // namespace extensions 352 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/blacklist.h ('k') | chrome/browser/extensions/blacklist_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698