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