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_HISTORY_SHORTCUTS_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_SHORTCUTS_DATABASE_H_ |
6 #define CHROME_BROWSER_HISTORY_SHORTCUTS_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_SHORTCUTS_DATABASE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "chrome/browser/history/shortcuts_backend.h" | 16 #include "chrome/browser/history/shortcuts_backend.h" |
17 #include "sql/connection.h" | 17 #include "sql/connection.h" |
| 18 #include "sql/meta_table.h" |
18 #include "url/gurl.h" | 19 #include "url/gurl.h" |
19 | 20 |
20 namespace history { | 21 namespace history { |
21 | 22 |
22 // This class manages the shortcut provider table within the SQLite database | 23 // This class manages the shortcut provider table within the SQLite database |
23 // passed to the constructor. It expects the following schema: | 24 // passed to the constructor. It expects the following schema: |
24 // | 25 // |
25 // Note: The database stores time in seconds, UTC. | 26 // Note: The database stores time in seconds, UTC. |
26 // | 27 // |
27 // omni_box_shortcuts | 28 // omni_box_shortcuts |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 75 |
75 virtual ~ShortcutsDatabase(); | 76 virtual ~ShortcutsDatabase(); |
76 | 77 |
77 // Ensures that the table is present. | 78 // Ensures that the table is present. |
78 bool EnsureTable(); | 79 bool EnsureTable(); |
79 | 80 |
80 // The sql database. Not valid until Init is called. | 81 // The sql database. Not valid until Init is called. |
81 sql::Connection db_; | 82 sql::Connection db_; |
82 base::FilePath database_path_; | 83 base::FilePath database_path_; |
83 | 84 |
| 85 sql::MetaTable meta_table_; |
| 86 |
84 static const base::FilePath::CharType kShortcutsDatabaseName[]; | 87 static const base::FilePath::CharType kShortcutsDatabaseName[]; |
85 | 88 |
86 DISALLOW_COPY_AND_ASSIGN(ShortcutsDatabase); | 89 DISALLOW_COPY_AND_ASSIGN(ShortcutsDatabase); |
87 }; | 90 }; |
88 | 91 |
89 } // namespace history | 92 } // namespace history |
90 | 93 |
91 #endif // CHROME_BROWSER_HISTORY_SHORTCUTS_DATABASE_H_ | 94 #endif // CHROME_BROWSER_HISTORY_SHORTCUTS_DATABASE_H_ |
OLD | NEW |