OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ |
6 #define CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ | 6 #define CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" |
9 #include "sql/connection.h" | 10 #include "sql/connection.h" |
10 #include "sql/init_status.h" | 11 #include "sql/init_status.h" |
11 #include "sql/meta_table.h" | 12 #include "sql/meta_table.h" |
12 | 13 |
13 class AutofillTable; | 14 class AutofillTable; |
14 class KeywordTable; | 15 class KeywordTable; |
15 class LoginsTable; | 16 class LoginsTable; |
16 class TokenServiceTable; | 17 class TokenServiceTable; |
17 class WebAppsTable; | 18 class WebAppsTable; |
| 19 class WebDatabaseTable; |
18 class WebIntentsTable; | 20 class WebIntentsTable; |
19 | 21 |
20 namespace base { | 22 namespace base { |
21 class FilePath; | 23 class FilePath; |
22 } | 24 } |
23 | 25 |
24 namespace content { | 26 namespace content { |
25 class NotificationService; | 27 class NotificationService; |
26 } | 28 } |
27 | 29 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 62 |
61 private: | 63 private: |
62 // Used by |Init()| to migration database schema from older versions to | 64 // Used by |Init()| to migration database schema from older versions to |
63 // current version. Requires the |app_locale| to be passed as a parameter as | 65 // current version. Requires the |app_locale| to be passed as a parameter as |
64 // the locale can only safely be queried on the UI thread. | 66 // the locale can only safely be queried on the UI thread. |
65 sql::InitStatus MigrateOldVersionsAsNeeded(const std::string& app_locale); | 67 sql::InitStatus MigrateOldVersionsAsNeeded(const std::string& app_locale); |
66 | 68 |
67 sql::Connection db_; | 69 sql::Connection db_; |
68 sql::MetaTable meta_table_; | 70 sql::MetaTable meta_table_; |
69 | 71 |
70 scoped_ptr<AutofillTable> autofill_table_; | 72 // TODO(joi): All of the typed pointers are going in a future |
71 scoped_ptr<KeywordTable> keyword_table_; | 73 // change, as we remove knowledge of the specific types from this |
72 scoped_ptr<LoginsTable> logins_table_; | 74 // class. |
73 scoped_ptr<TokenServiceTable> token_service_table_; | 75 AutofillTable* autofill_table_; |
74 scoped_ptr<WebAppsTable> web_apps_table_; | 76 KeywordTable* keyword_table_; |
| 77 LoginsTable* logins_table_; |
| 78 TokenServiceTable* token_service_table_; |
| 79 WebAppsTable* web_apps_table_; |
75 // TODO(thakis): Add a migration to delete this table, then remove this. | 80 // TODO(thakis): Add a migration to delete this table, then remove this. |
76 scoped_ptr<WebIntentsTable> web_intents_table_; | 81 WebIntentsTable* web_intents_table_; |
| 82 |
| 83 // Owns all the different database tables that have been added to |
| 84 // this object. |
| 85 ScopedVector<WebDatabaseTable> tables_; |
77 | 86 |
78 scoped_ptr<content::NotificationService> notification_service_; | 87 scoped_ptr<content::NotificationService> notification_service_; |
79 | 88 |
80 DISALLOW_COPY_AND_ASSIGN(WebDatabase); | 89 DISALLOW_COPY_AND_ASSIGN(WebDatabase); |
81 }; | 90 }; |
82 | 91 |
83 #endif // CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ | 92 #endif // CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ |
OLD | NEW |