Home | History | Annotate | Download | only in predictors
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_PREDICTORS_PREDICTOR_DATABASE_H_
      6 #define CHROME_BROWSER_PREDICTORS_PREDICTOR_DATABASE_H_
      7 
      8 #include "base/memory/ref_counted.h"
      9 #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
     10 
     11 class Profile;
     12 
     13 namespace sql {
     14 class Connection;
     15 }
     16 
     17 namespace predictors {
     18 
     19 class AutocompleteActionPredictorTable;
     20 class LoggedInPredictorTable;
     21 class PredictorDatabaseInternal;
     22 class ResourcePrefetchPredictorTables;
     23 
     24 class PredictorDatabase : public BrowserContextKeyedService {
     25  public:
     26   explicit PredictorDatabase(Profile* profile);
     27   virtual ~PredictorDatabase();
     28 
     29   scoped_refptr<AutocompleteActionPredictorTable> autocomplete_table();
     30   scoped_refptr<ResourcePrefetchPredictorTables> resource_prefetch_tables();
     31   scoped_refptr<LoggedInPredictorTable> logged_in_table();
     32 
     33   // Used for testing.
     34   sql::Connection* GetDatabase();
     35 
     36  private:
     37   // BrowserContextKeyedService
     38   virtual void Shutdown() OVERRIDE;
     39 
     40   scoped_refptr<PredictorDatabaseInternal> db_;
     41 
     42   DISALLOW_COPY_AND_ASSIGN(PredictorDatabase);
     43 };
     44 
     45 }  // namespace predictors
     46 
     47 #endif  // CHROME_BROWSER_PREDICTORS_PREDICTOR_DATABASE_H_
     48