OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_STARRED_URL_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_STARRED_URL_DATABASE_H_ |
6 #define CHROME_BROWSER_HISTORY_STARRED_URL_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_STARRED_URL_DATABASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 // URLDatabase before using this class' functions. | 32 // URLDatabase before using this class' functions. |
33 StarredURLDatabase(); | 33 StarredURLDatabase(); |
34 virtual ~StarredURLDatabase(); | 34 virtual ~StarredURLDatabase(); |
35 | 35 |
36 protected: | 36 protected: |
37 // The unit tests poke our innards. | 37 // The unit tests poke our innards. |
38 friend class HistoryTest; | 38 friend class HistoryTest; |
39 friend class StarredURLDatabaseTest; | 39 friend class StarredURLDatabaseTest; |
40 FRIEND_TEST_ALL_PREFIXES(HistoryTest, CreateStarFolder); | 40 FRIEND_TEST_ALL_PREFIXES(HistoryTest, CreateStarFolder); |
41 | 41 |
| 42 // ID (both star_id and folder_id) of the bookmark bar. |
| 43 // This entry always exists. |
| 44 static const int64 kBookmarkBarID; |
| 45 |
42 // Writes bookmarks to the specified file. | 46 // Writes bookmarks to the specified file. |
43 bool MigrateBookmarksToFile(const FilePath& path); | 47 bool MigrateBookmarksToFile(const FilePath& path); |
44 | 48 |
45 // Returns the database for the functions in this interface. | 49 // Returns the database for the functions in this interface. |
46 virtual sql::Connection& GetDB() = 0; | 50 virtual sql::Connection& GetDB() = 0; |
47 | 51 |
48 private: | 52 private: |
49 // Makes sure the starred table is in a sane state. This does the following: | 53 // Makes sure the starred table is in a sane state. This does the following: |
50 // . Makes sure there is a bookmark bar and other nodes. If no bookmark bar | 54 // . Makes sure there is a bookmark bar and other nodes. If no bookmark bar |
51 // node is found, the table is dropped and recreated. | 55 // node is found, the table is dropped and recreated. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // Does the work of migrating bookmarks to a temporary file that | 181 // Does the work of migrating bookmarks to a temporary file that |
178 // BookmarkStorage will read from. | 182 // BookmarkStorage will read from. |
179 bool MigrateBookmarksToFileImpl(const FilePath& path); | 183 bool MigrateBookmarksToFileImpl(const FilePath& path); |
180 | 184 |
181 DISALLOW_COPY_AND_ASSIGN(StarredURLDatabase); | 185 DISALLOW_COPY_AND_ASSIGN(StarredURLDatabase); |
182 }; | 186 }; |
183 | 187 |
184 } // namespace history | 188 } // namespace history |
185 | 189 |
186 #endif // CHROME_BROWSER_HISTORY_STARRED_URL_DATABASE_H_ | 190 #endif // CHROME_BROWSER_HISTORY_STARRED_URL_DATABASE_H_ |
OLD | NEW |