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_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ |
6 #define CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ | 6 #define CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ |
7 | 7 |
8 #include "chrome/browser/history/android/sql_handler.h" | 8 #include "chrome/browser/history/android/sql_handler.h" |
9 | 9 |
10 class BookmarkModel; | 10 class BookmarkModel; |
11 class Profile; | 11 class Profile; |
12 | 12 |
13 namespace history { | 13 namespace history { |
14 | 14 |
15 class HistoryDatabase; | 15 class HistoryDatabase; |
16 | 16 |
17 // The SQL handler for bookmarking_mapping table. | 17 // The SQL handler for bookmarking_mapping table. |
18 class BookmarkModelSQLHandler : public SQLHandler { | 18 class BookmarkModelSQLHandler : public SQLHandler { |
19 public: | 19 public: |
20 explicit BookmarkModelSQLHandler(URLDatabase* url_database); | 20 explicit BookmarkModelSQLHandler(URLDatabase* url_database); |
21 | 21 |
22 virtual ~BookmarkModelSQLHandler(); | 22 virtual ~BookmarkModelSQLHandler(); |
23 | 23 |
24 // SQLHandler overrides: | 24 // SQLHandler overrides: |
25 virtual bool Update(const HistoryAndBookmarkRow& row, | 25 virtual bool Update(const HistoryAndBookmarkRow& row, |
26 const TableIDRows& ids_set) OVERRIDE; | 26 const TableIDRows& ids_set) override; |
27 virtual bool Delete(const TableIDRows& ids_set) OVERRIDE; | 27 virtual bool Delete(const TableIDRows& ids_set) override; |
28 virtual bool Insert(HistoryAndBookmarkRow* row) OVERRIDE; | 28 virtual bool Insert(HistoryAndBookmarkRow* row) override; |
29 | 29 |
30 private: | 30 private: |
31 // This class helps to modify the bookmark model in UI thread. | 31 // This class helps to modify the bookmark model in UI thread. |
32 // The instance of this class is created in history thread and posted to | 32 // The instance of this class is created in history thread and posted to |
33 // UI thread to access the bookmark. All method must be run in UI thread. | 33 // UI thread to access the bookmark. All method must be run in UI thread. |
34 class Task : public base::RefCountedThreadSafe<Task> { | 34 class Task : public base::RefCountedThreadSafe<Task> { |
35 public: | 35 public: |
36 // |profile| is the profile whose BookmarkModel will be modified. | 36 // |profile| is the profile whose BookmarkModel will be modified. |
37 // | 37 // |
38 // As this class is instantiated in history thread, the |profile| will be | 38 // As this class is instantiated in history thread, the |profile| will be |
(...skipping 29 matching lines...) Expand all Loading... |
68 }; | 68 }; |
69 | 69 |
70 URLDatabase* url_database_; | 70 URLDatabase* url_database_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(BookmarkModelSQLHandler); | 72 DISALLOW_COPY_AND_ASSIGN(BookmarkModelSQLHandler); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace history. | 75 } // namespace history. |
76 | 76 |
77 #endif // CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ | 77 #endif // CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ |
OLD | NEW |