| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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_HISTORY_PUBLISHER_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_PUBLISHER_H_ |
| 6 #define CHROME_BROWSER_HISTORY_HISTORY_PUBLISHER_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_PUBLISHER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/string16.h" | |
| 13 | 12 |
| 14 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 15 #include "base/scoped_comptr_win.h" | 14 #include "base/scoped_comptr_win.h" |
| 16 #include "history_indexer.h" | 15 #include "history_indexer.h" |
| 17 #endif | 16 #endif |
| 18 | 17 |
| 19 class GURL; | 18 class GURL; |
| 20 | 19 |
| 21 namespace base { | 20 namespace base { |
| 22 class Time; | 21 class Time; |
| 23 } | 22 } |
| 24 | 23 |
| 25 namespace history { | 24 namespace history { |
| 26 | 25 |
| 27 class HistoryPublisher { | 26 class HistoryPublisher { |
| 28 public: | 27 public: |
| 29 HistoryPublisher(); | 28 HistoryPublisher(); |
| 30 ~HistoryPublisher(); | 29 ~HistoryPublisher(); |
| 31 | 30 |
| 32 // Must call this function to complete initialization. Returns true if we | 31 // Must call this function to complete initialization. Returns true if we |
| 33 // need to publish data to any indexers registered with us. Returns false if | 32 // need to publish data to any indexers registered with us. Returns false if |
| 34 // there are none registered. On false, no other function should be called. | 33 // there are none registered. On false, no other function should be called. |
| 35 bool Init(); | 34 bool Init(); |
| 36 | 35 |
| 37 void PublishPageThumbnail(const std::vector<unsigned char>& thumbnail, | 36 void PublishPageThumbnail(const std::vector<unsigned char>& thumbnail, |
| 38 const GURL& url, const base::Time& time) const; | 37 const GURL& url, const base::Time& time) const; |
| 39 void PublishPageContent(const base::Time& time, const GURL& url, | 38 void PublishPageContent(const base::Time& time, const GURL& url, |
| 40 const std::wstring& title, | 39 const std::wstring& title, |
| 41 const string16& contents) const; | 40 const std::wstring& contents) const; |
| 42 void DeleteUserHistoryBetween(const base::Time& begin_time, | 41 void DeleteUserHistoryBetween(const base::Time& begin_time, |
| 43 const base::Time& end_time) const; | 42 const base::Time& end_time) const; |
| 44 | 43 |
| 45 private: | 44 private: |
| 46 struct PageData { | 45 struct PageData { |
| 47 const base::Time& time; | 46 const base::Time& time; |
| 48 const GURL& url; | 47 const GURL& url; |
| 49 const wchar_t* html; | 48 const wchar_t* html; |
| 50 const wchar_t* title; | 49 const wchar_t* title; |
| 51 const char* thumbnail_format; | 50 const char* thumbnail_format; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 75 | 74 |
| 76 // The format of the thumbnail we pass to indexers. | 75 // The format of the thumbnail we pass to indexers. |
| 77 static const char* const kThumbnailImageFormat; | 76 static const char* const kThumbnailImageFormat; |
| 78 | 77 |
| 79 DISALLOW_COPY_AND_ASSIGN(HistoryPublisher); | 78 DISALLOW_COPY_AND_ASSIGN(HistoryPublisher); |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 } // namespace history | 81 } // namespace history |
| 83 | 82 |
| 84 #endif // CHROME_BROWSER_HISTORY_HISTORY_PUBLISHER_H_ | 83 #endif // CHROME_BROWSER_HISTORY_HISTORY_PUBLISHER_H_ |
| OLD | NEW |