| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "sql/init_status.h" | 10 #include "sql/init_status.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class FilePath; | 15 class FilePath; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace history { | 18 namespace history { |
| 19 | 19 |
| 20 class HistoryBackend; | 20 class HistoryBackend; |
| 21 class HistoryBackendClient; | 21 class HistoryBackendClient; |
| 22 class HistoryDatabase; | 22 class HistoryDatabase; |
| 23 class HistoryService; |
| 23 class ThumbnailDatabase; | 24 class ThumbnailDatabase; |
| 24 | 25 |
| 25 // This class abstracts operations that depend on the embedder's environment, | 26 // This class abstracts operations that depend on the embedder's environment, |
| 26 // e.g. Chrome. | 27 // e.g. Chrome. |
| 27 class HistoryClient { | 28 class HistoryClient { |
| 28 public: | 29 public: |
| 29 HistoryClient() {} | 30 HistoryClient() {} |
| 30 virtual ~HistoryClient() {} | 31 virtual ~HistoryClient() {} |
| 31 | 32 |
| 33 // Called upon HistoryService creation. |
| 34 virtual void OnHistoryServiceCreated(HistoryService* history_service) = 0; |
| 35 |
| 32 // Called before HistoryService is shutdown. | 36 // Called before HistoryService is shutdown. |
| 33 virtual void Shutdown() = 0; | 37 virtual void Shutdown() = 0; |
| 34 | 38 |
| 35 // Returns true if this look like the type of URL that should be added to the | 39 // Returns true if this look like the type of URL that should be added to the |
| 36 // history. | 40 // history. |
| 37 virtual bool CanAddURL(const GURL& url) = 0; | 41 virtual bool CanAddURL(const GURL& url) = 0; |
| 38 | 42 |
| 39 // Notifies the embedder that there was a problem reading the database. | 43 // Notifies the embedder that there was a problem reading the database. |
| 40 virtual void NotifyProfileError(sql::InitStatus init_status) = 0; | 44 virtual void NotifyProfileError(sql::InitStatus init_status) = 0; |
| 41 | 45 |
| 42 // Returns a new HistoryBackendClient instance. | 46 // Returns a new HistoryBackendClient instance. |
| 43 virtual scoped_ptr<HistoryBackendClient> CreateBackendClient() = 0; | 47 virtual scoped_ptr<HistoryBackendClient> CreateBackendClient() = 0; |
| 44 | 48 |
| 45 private: | 49 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(HistoryClient); | 50 DISALLOW_COPY_AND_ASSIGN(HistoryClient); |
| 47 }; | 51 }; |
| 48 | 52 |
| 49 } // namespace history | 53 } // namespace history |
| 50 | 54 |
| 51 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ | 55 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ |
| OLD | NEW |