| OLD | NEW |
| 1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-2009 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 #include "chrome/browser/history/history_publisher.h" | 5 #include "chrome/browser/history/history_publisher.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" |
| 8 |
| 7 namespace history { | 9 namespace history { |
| 8 | 10 |
| 9 const char* const HistoryPublisher::kThumbnailImageFormat = "image/jpeg"; | 11 const char* const HistoryPublisher::kThumbnailImageFormat = "image/jpeg"; |
| 10 | 12 |
| 11 void HistoryPublisher::PublishPageThumbnail( | 13 void HistoryPublisher::PublishPageThumbnail( |
| 12 const std::vector<unsigned char>& thumbnail, const GURL& url, | 14 const std::vector<unsigned char>& thumbnail, const GURL& url, |
| 13 const base::Time& time) const { | 15 const base::Time& time) const { |
| 14 PageData page_data = { | 16 PageData page_data = { |
| 15 time, | 17 time, |
| 16 url, | 18 url, |
| 17 NULL, | 19 NULL, |
| 18 NULL, | 20 NULL, |
| 19 kThumbnailImageFormat, | 21 kThumbnailImageFormat, |
| 20 &thumbnail, | 22 &thumbnail, |
| 21 }; | 23 }; |
| 22 | 24 |
| 23 PublishDataToIndexers(page_data); | 25 PublishDataToIndexers(page_data); |
| 24 } | 26 } |
| 25 | 27 |
| 26 void HistoryPublisher::PublishPageContent(const base::Time& time, | 28 void HistoryPublisher::PublishPageContent(const base::Time& time, |
| 27 const GURL& url, | 29 const GURL& url, |
| 28 const std::wstring& title, | 30 const std::wstring& title, |
| 29 const std::wstring& contents) const { | 31 const string16& contents) const { |
| 30 PageData page_data = { | 32 PageData page_data = { |
| 31 time, | 33 time, |
| 32 url, | 34 url, |
| 33 contents.c_str(), | 35 UTF16ToWide(contents).c_str(), |
| 34 title.c_str(), | 36 title.c_str(), |
| 35 NULL, | 37 NULL, |
| 36 NULL, | 38 NULL, |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 PublishDataToIndexers(page_data); | 41 PublishDataToIndexers(page_data); |
| 40 } | 42 } |
| 41 | 43 |
| 42 } // namespace history | 44 } // namespace history |
| OLD | NEW |