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_FAVICON_SQL_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_ANDROID_FAVICON_SQL_HANDLER_H_ |
6 #define CHROME_BROWSER_HISTORY_ANDROID_FAVICON_SQL_HANDLER_H_ | 6 #define CHROME_BROWSER_HISTORY_ANDROID_FAVICON_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 namespace history { | 10 namespace history { |
11 | 11 |
12 class ThumbnailDatabase; | 12 class ThumbnailDatabase; |
13 | 13 |
14 // The SQL handler implementation for icon_mapping and favicon table. | 14 // The SQL handler implementation for icon_mapping and favicon table. |
15 class FaviconSQLHandler : public SQLHandler { | 15 class FaviconSQLHandler : public SQLHandler { |
16 public: | 16 public: |
17 explicit FaviconSQLHandler(ThumbnailDatabase* thumbnail_db); | 17 explicit FaviconSQLHandler(ThumbnailDatabase* thumbnail_db); |
18 virtual ~FaviconSQLHandler(); | 18 virtual ~FaviconSQLHandler(); |
19 | 19 |
20 // SQLHandler overrides: | 20 // SQLHandler overrides: |
21 virtual bool Update(const HistoryAndBookmarkRow& row, | 21 virtual bool Update(const HistoryAndBookmarkRow& row, |
22 const TableIDRows& ids_set) OVERRIDE; | 22 const TableIDRows& ids_set) override; |
23 virtual bool Delete(const TableIDRows& ids_set) OVERRIDE; | 23 virtual bool Delete(const TableIDRows& ids_set) override; |
24 virtual bool Insert(HistoryAndBookmarkRow* row) OVERRIDE; | 24 virtual bool Insert(HistoryAndBookmarkRow* row) override; |
25 | 25 |
26 private: | 26 private: |
27 // Deletes the given favicons if they are not used by any pages. Returns | 27 // Deletes the given favicons if they are not used by any pages. Returns |
28 // true if all unused favicons are deleted. | 28 // true if all unused favicons are deleted. |
29 bool DeleteUnusedFavicon(const std::vector<favicon_base::FaviconID>& ids); | 29 bool DeleteUnusedFavicon(const std::vector<favicon_base::FaviconID>& ids); |
30 | 30 |
31 ThumbnailDatabase* thumbnail_db_; | 31 ThumbnailDatabase* thumbnail_db_; |
32 | 32 |
33 DISALLOW_COPY_AND_ASSIGN(FaviconSQLHandler); | 33 DISALLOW_COPY_AND_ASSIGN(FaviconSQLHandler); |
34 }; | 34 }; |
35 | 35 |
36 } // namespace history. | 36 } // namespace history. |
37 | 37 |
38 #endif // CHROME_BROWSER_HISTORY_ANDROID_FAVICON_SQL_HANDLER_H_ | 38 #endif // CHROME_BROWSER_HISTORY_ANDROID_FAVICON_SQL_HANDLER_H_ |
OLD | NEW |