| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ |
| 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 virtual bool IsBookmarked(const GURL& url); | 45 virtual bool IsBookmarked(const GURL& url); |
| 46 | 46 |
| 47 // Returns, by reference in |bookmarks|, the set of bookmarked urls and their | 47 // Returns, by reference in |bookmarks|, the set of bookmarked urls and their |
| 48 // titles. This returns the unique set of URLs. For example, if two bookmarks | 48 // titles. This returns the unique set of URLs. For example, if two bookmarks |
| 49 // reference the same URL only one entry is added even if the title are not | 49 // reference the same URL only one entry is added even if the title are not |
| 50 // the same. | 50 // the same. |
| 51 // | 51 // |
| 52 // If not on the main thread, then BlockUntilBookmarksLoaded must be called. | 52 // If not on the main thread, then BlockUntilBookmarksLoaded must be called. |
| 53 virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks); | 53 virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks); |
| 54 | 54 |
| 55 // Returns true if this look like the type of URL that should be added to the |
| 56 // history. |
| 57 virtual bool CanAddURL(const GURL& url); |
| 58 |
| 55 // Notifies the embedder that there was a problem reading the database. | 59 // Notifies the embedder that there was a problem reading the database. |
| 56 // | 60 // |
| 57 // Must be called from the main thread. | 61 // Must be called from the main thread. |
| 58 virtual void NotifyProfileError(sql::InitStatus init_status); | 62 virtual void NotifyProfileError(sql::InitStatus init_status); |
| 59 | 63 |
| 60 // Returns whether database errors should be reported to the crash server. | 64 // Returns whether database errors should be reported to the crash server. |
| 61 virtual bool ShouldReportDatabaseError(); | 65 virtual bool ShouldReportDatabaseError(); |
| 62 | 66 |
| 63 // Called upon initialization of the HistoryBackend. | 67 // Called upon initialization of the HistoryBackend. |
| 64 virtual void OnHistoryBackendInitialized( | 68 virtual void OnHistoryBackendInitialized( |
| 65 HistoryBackend* history_backend, | 69 HistoryBackend* history_backend, |
| 66 HistoryDatabase* history_database, | 70 HistoryDatabase* history_database, |
| 67 ThumbnailDatabase* thumbnail_database, | 71 ThumbnailDatabase* thumbnail_database, |
| 68 const base::FilePath& history_dir); | 72 const base::FilePath& history_dir); |
| 69 | 73 |
| 70 // Called upon destruction of the HistoryBackend. | 74 // Called upon destruction of the HistoryBackend. |
| 71 virtual void OnHistoryBackendDestroyed(HistoryBackend* history_backend, | 75 virtual void OnHistoryBackendDestroyed(HistoryBackend* history_backend, |
| 72 const base::FilePath& history_dir); | 76 const base::FilePath& history_dir); |
| 73 | 77 |
| 74 protected: | 78 protected: |
| 75 DISALLOW_COPY_AND_ASSIGN(HistoryClient); | 79 DISALLOW_COPY_AND_ASSIGN(HistoryClient); |
| 76 }; | 80 }; |
| 77 | 81 |
| 78 } // namespace history | 82 } // namespace history |
| 79 | 83 |
| 80 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ | 84 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ |
| OLD | NEW |