| 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_ANDROID_HISTORY_PROVIDER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_ANDROID_ANDROID_HISTORY_PROVIDER_SERVICE_H_ |
| 6 #define CHROME_BROWSER_HISTORY_ANDROID_ANDROID_HISTORY_PROVIDER_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_ANDROID_ANDROID_HISTORY_PROVIDER_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 10 #include "base/task/cancelable_task_tracker.h" | 13 #include "base/task/cancelable_task_tracker.h" |
| 11 #include "components/favicon_base/favicon_callback.h" | 14 #include "components/favicon_base/favicon_callback.h" |
| 12 #include "components/history/core/browser/android/android_history_types.h" | 15 #include "components/history/core/browser/android/android_history_types.h" |
| 13 | 16 |
| 14 class Profile; | 17 class Profile; |
| 15 | 18 |
| 16 // This class provides the methods to communicate with history backend service | 19 // This class provides the methods to communicate with history backend service |
| 17 // for the Android content provider. | 20 // for the Android content provider. |
| 18 // The methods of this class must run on the UI thread to cooperate with the | 21 // The methods of this class must run on the UI thread to cooperate with the |
| 19 // BookmarkModel task posted in the DB thread. | 22 // BookmarkModel task posted in the DB thread. |
| 20 class AndroidHistoryProviderService { | 23 class AndroidHistoryProviderService { |
| 21 public: | 24 public: |
| 22 explicit AndroidHistoryProviderService(Profile* profile); | 25 explicit AndroidHistoryProviderService(Profile* profile); |
| 23 virtual ~AndroidHistoryProviderService(); | 26 virtual ~AndroidHistoryProviderService(); |
| 24 | 27 |
| 25 // The callback definitions ------------------------------------------------ | 28 // The callback definitions ------------------------------------------------ |
| 26 | 29 |
| 27 // Callback invoked when a method creating an |AndroidStatement| object is | 30 // Callback invoked when a method creating an |AndroidStatement| object is |
| 28 // complete. The pointer is NULL if the creation failed. | 31 // complete. The pointer is NULL if the creation failed. |
| 29 typedef base::Callback<void(history::AndroidStatement*)> QueryCallback; | 32 typedef base::Callback<void(history::AndroidStatement*)> QueryCallback; |
| 30 | 33 |
| 31 // Callback invoked when a method updating rows in the database complete. | 34 // Callback invoked when a method updating rows in the database complete. |
| 32 // The parameter is the number of rows updated or 0 if the update failed. | 35 // The parameter is the number of rows updated or 0 if the update failed. |
| 33 typedef base::Callback<void(int)> UpdateCallback; | 36 typedef base::Callback<void(int)> UpdateCallback; |
| 34 | 37 |
| 35 // Callback invoked when a method inserting rows in the database complete. | 38 // Callback invoked when a method inserting rows in the database complete. |
| 36 // The value is the new row id or 0 if the insertion failed. | 39 // The value is the new row id or 0 if the insertion failed. |
| 37 typedef base::Callback<void(int64)> InsertCallback; | 40 typedef base::Callback<void(int64_t)> InsertCallback; |
| 38 | 41 |
| 39 // Callback invoked when a method deleting rows in the database complete. | 42 // Callback invoked when a method deleting rows in the database complete. |
| 40 // The value is the number of rows deleted or 0 if the deletion failed. | 43 // The value is the number of rows deleted or 0 if the deletion failed. |
| 41 typedef base::Callback<void(int)> DeleteCallback; | 44 typedef base::Callback<void(int)> DeleteCallback; |
| 42 | 45 |
| 43 // Callback invoked when a method moving an |AndroidStatement| is complete. | 46 // Callback invoked when a method moving an |AndroidStatement| is complete. |
| 44 // The value passed to the callback is the new position, or in case of | 47 // The value passed to the callback is the new position, or in case of |
| 45 // failure, the old position. | 48 // failure, the old position. |
| 46 typedef base::Callback<void(int)> MoveStatementCallback; | 49 typedef base::Callback<void(int)> MoveStatementCallback; |
| 47 | 50 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 const favicon_base::FaviconRawBitmapCallback& callback, | 177 const favicon_base::FaviconRawBitmapCallback& callback, |
| 175 base::CancelableTaskTracker* tracker); | 178 base::CancelableTaskTracker* tracker); |
| 176 | 179 |
| 177 private: | 180 private: |
| 178 Profile* profile_; | 181 Profile* profile_; |
| 179 | 182 |
| 180 DISALLOW_COPY_AND_ASSIGN(AndroidHistoryProviderService); | 183 DISALLOW_COPY_AND_ASSIGN(AndroidHistoryProviderService); |
| 181 }; | 184 }; |
| 182 | 185 |
| 183 #endif // CHROME_BROWSER_HISTORY_ANDROID_ANDROID_HISTORY_PROVIDER_SERVICE_H_ | 186 #endif // CHROME_BROWSER_HISTORY_ANDROID_ANDROID_HISTORY_PROVIDER_SERVICE_H_ |
| OLD | NEW |