OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BOOKMARKS_BOOKMARK_STORAGE_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 // Called when history has written the file with bookmarks data. Loads data | 123 // Called when history has written the file with bookmarks data. Loads data |
124 // from that file. | 124 // from that file. |
125 void OnHistoryFinishedWriting(); | 125 void OnHistoryFinishedWriting(); |
126 | 126 |
127 // Called after we loaded file generated by history. Saves the data, deletes | 127 // Called after we loaded file generated by history. Saves the data, deletes |
128 // the temporary file, and notifies the model. | 128 // the temporary file, and notifies the model. |
129 void FinishHistoryMigration(); | 129 void FinishHistoryMigration(); |
130 | 130 |
131 // NotificationObserver | 131 // NotificationObserver |
132 void Observe(NotificationType type, const NotificationSource& source, | 132 virtual void Observe(NotificationType type, |
133 const NotificationDetails& details); | 133 const NotificationSource& source, |
| 134 const NotificationDetails& details); |
134 | 135 |
135 // Serializes the data and schedules save using ImportantFileWriter. | 136 // Serializes the data and schedules save using ImportantFileWriter. |
136 // Returns true on successful serialization. | 137 // Returns true on successful serialization. |
137 bool SaveNow(); | 138 bool SaveNow(); |
138 | 139 |
139 // Keep the pointer to profile, we may need it for migration from history. | 140 // Keep the pointer to profile, we may need it for migration from history. |
140 Profile* profile_; | 141 Profile* profile_; |
141 | 142 |
142 // The model. The model is NULL once BookmarkModelDeleted has been invoked. | 143 // The model. The model is NULL once BookmarkModelDeleted has been invoked. |
143 BookmarkModel* model_; | 144 BookmarkModel* model_; |
144 | 145 |
145 // Helper to write bookmark data safely. | 146 // Helper to write bookmark data safely. |
146 ImportantFileWriter writer_; | 147 ImportantFileWriter writer_; |
147 | 148 |
148 // Helper to ensure that we unregister from notifications on destruction. | 149 // Helper to ensure that we unregister from notifications on destruction. |
149 NotificationRegistrar notification_registrar_; | 150 NotificationRegistrar notification_registrar_; |
150 | 151 |
151 // Path to temporary file created during migrating bookmarks from history. | 152 // Path to temporary file created during migrating bookmarks from history. |
152 const FilePath tmp_history_path_; | 153 const FilePath tmp_history_path_; |
153 | 154 |
154 // See class description of BookmarkLoadDetails for details on this. | 155 // See class description of BookmarkLoadDetails for details on this. |
155 scoped_ptr<BookmarkLoadDetails> details_; | 156 scoped_ptr<BookmarkLoadDetails> details_; |
156 | 157 |
157 DISALLOW_COPY_AND_ASSIGN(BookmarkStorage); | 158 DISALLOW_COPY_AND_ASSIGN(BookmarkStorage); |
158 }; | 159 }; |
159 | 160 |
160 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_ | 161 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_ |
OLD | NEW |