Home | History | Annotate | Download | only in activity_log
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_
      6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_
      7 
      8 #include "chrome/browser/extensions/activity_log/ad_network_database.h"
      9 
     10 namespace extensions {
     11 
     12 // The standard ("real") implementation of the AdNetworkDatabase, which stores
     13 // a list of hashes of ad networks.
     14 class HashedAdNetworkDatabase : public AdNetworkDatabase {
     15  public:
     16   HashedAdNetworkDatabase();
     17   virtual ~HashedAdNetworkDatabase();
     18 
     19   void set_entries_for_testing(const char** entries, int num_entries) {
     20     entries_ = entries;
     21     num_entries_ = num_entries;
     22   }
     23 
     24  private:
     25   // AdNetworkDatabase implementation.
     26   virtual bool IsAdNetwork(const GURL& url) const OVERRIDE;
     27 
     28   // Points to the array of hash entries. In practice, this is always set to
     29   // kHashedAdNetworks, but is exposed via set_entries_for_testing().
     30   const char** entries_;
     31 
     32   // The number of entries.
     33   int num_entries_;
     34 };
     35 
     36 }  // namespace extensions
     37 
     38 #endif  // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_
     39