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