| 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 <atlsafe.h> | 7 #include <atlsafe.h> |
| 8 #include <objbase.h> | 8 #include <objbase.h> |
| 9 #include <oleauto.h> | 9 #include <oleauto.h> |
| 10 #include <wtypes.h> | 10 #include <wtypes.h> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 if (page_data.thumbnail) { | 113 if (page_data.thumbnail) { |
| 114 for (size_t i = 0; i < page_data.thumbnail->size(); ++i) | 114 for (size_t i = 0; i < page_data.thumbnail->size(); ++i) |
| 115 thumbnail_arr.Add((*page_data.thumbnail)[i]); | 115 thumbnail_arr.Add((*page_data.thumbnail)[i]); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Send data to registered indexers. | 118 // Send data to registered indexers. |
| 119 ScopedVariant time(var_time, VT_DATE); | 119 ScopedVariant time(var_time, VT_DATE); |
| 120 ScopedBstr url(ASCIIToWide(page_data.url.spec()).c_str()); | 120 ScopedBstr url(ASCIIToWide(page_data.url.spec()).c_str()); |
| 121 ScopedBstr html(page_data.html); | 121 ScopedBstr html(page_data.html); |
| 122 ScopedBstr title(page_data.title); | 122 ScopedBstr title(page_data.title); |
| 123 ScopedBstr format(ASCIIToWide(page_data.thumbnail_format).c_str()); | 123 // Don't send a NULL string through ASCIIToWide. |
| 124 ScopedBstr format(page_data.thumbnail_format ? |
| 125 ASCIIToWide(page_data.thumbnail_format).c_str() : |
| 126 NULL); |
| 124 ScopedVariant psa(thumbnail_arr.m_psa); | 127 ScopedVariant psa(thumbnail_arr.m_psa); |
| 125 for (size_t i = 0; i < indexers_.size(); ++i) { | 128 for (size_t i = 0; i < indexers_.size(); ++i) { |
| 126 indexers_[i]->SendPageData(time, url, html, title, format, psa); | 129 indexers_[i]->SendPageData(time, url, html, title, format, psa); |
| 127 } | 130 } |
| 128 } | 131 } |
| 129 | 132 |
| 130 void HistoryPublisher::DeleteUserHistoryBetween(const base::Time& begin_time, | 133 void HistoryPublisher::DeleteUserHistoryBetween(const base::Time& begin_time, |
| 131 const base::Time& end_time) | 134 const base::Time& end_time) |
| 132 const { | 135 const { |
| 133 ScopedVariant var_begin_time(TimeToUTCVariantTime(begin_time), VT_DATE); | 136 ScopedVariant var_begin_time(TimeToUTCVariantTime(begin_time), VT_DATE); |
| 134 ScopedVariant var_end_time(TimeToUTCVariantTime(end_time), VT_DATE); | 137 ScopedVariant var_end_time(TimeToUTCVariantTime(end_time), VT_DATE); |
| 135 for (size_t i = 0; i < indexers_.size(); ++i) { | 138 for (size_t i = 0; i < indexers_.size(); ++i) { |
| 136 indexers_[i]->DeleteUserHistoryBetween(var_begin_time, var_end_time); | 139 indexers_[i]->DeleteUserHistoryBetween(var_begin_time, var_end_time); |
| 137 } | 140 } |
| 138 } | 141 } |
| 139 | 142 |
| 140 } // namespace history | 143 } // namespace history |
| OLD | NEW |