1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/history/history_publisher.h" 6 7 #include "base/strings/utf_string_conversions.h" 8 9 namespace history { 10 11 const char* const HistoryPublisher::kThumbnailImageFormat = "image/jpeg"; 12 13 void HistoryPublisher::PublishPageThumbnail( 14 const std::vector<unsigned char>& thumbnail, const GURL& url, 15 const base::Time& time) const { 16 PageData page_data = { 17 time, 18 url, 19 NULL, 20 NULL, 21 kThumbnailImageFormat, 22 &thumbnail, 23 }; 24 25 PublishDataToIndexers(page_data); 26 } 27 28 void HistoryPublisher::PublishPageContent(const base::Time& time, 29 const GURL& url, 30 const string16& title, 31 const string16& contents) const { 32 PageData page_data = { 33 time, 34 url, 35 contents.c_str(), 36 title.c_str(), 37 NULL, 38 NULL, 39 }; 40 41 PublishDataToIndexers(page_data); 42 } 43 44 } // namespace history 45