OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/drive/search_metadata.h" | 5 #include "chrome/browser/chromeos/drive/search_metadata.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 entry.file_info().is_directory()) | 159 entry.file_info().is_directory()) |
160 return false; | 160 return false; |
161 | 161 |
162 if (options & SEARCH_METADATA_SHARED_WITH_ME) | 162 if (options & SEARCH_METADATA_SHARED_WITH_ME) |
163 return entry.shared_with_me(); | 163 return entry.shared_with_me(); |
164 | 164 |
165 if (options & SEARCH_METADATA_OFFLINE) { | 165 if (options & SEARCH_METADATA_OFFLINE) { |
166 if (entry.file_specific_info().is_hosted_document()) { | 166 if (entry.file_specific_info().is_hosted_document()) { |
167 // Not all hosted documents are cached by Drive offline app. | 167 // Not all hosted documents are cached by Drive offline app. |
168 // http://support.google.com/drive/bin/answer.py?hl=en&answer=1628467 | 168 // http://support.google.com/drive/bin/answer.py?hl=en&answer=1628467 |
169 std::string mime_type = drive::util::GetHostedDocumentMimeType( | 169 std::string mime_type = entry.file_specific_info().content_mime_type(); |
170 entry.file_specific_info().document_extension()); | |
171 return mime_type == drive::util::kGoogleDocumentMimeType || | 170 return mime_type == drive::util::kGoogleDocumentMimeType || |
172 mime_type == drive::util::kGoogleSpreadsheetMimeType || | 171 mime_type == drive::util::kGoogleSpreadsheetMimeType || |
173 mime_type == drive::util::kGooglePresentationMimeType || | 172 mime_type == drive::util::kGooglePresentationMimeType || |
174 mime_type == drive::util::kGoogleDrawingMimeType; | 173 mime_type == drive::util::kGoogleDrawingMimeType; |
175 } else { | 174 } else { |
176 return entry.file_specific_info().cache_state().is_present(); | 175 return entry.file_specific_info().cache_state().is_present(); |
177 } | 176 } |
178 } | 177 } |
179 | 178 |
180 return true; | 179 return true; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(pre))); | 346 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(pre))); |
348 highlighted_text->append("<b>"); | 347 highlighted_text->append("<b>"); |
349 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(match))); | 348 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(match))); |
350 highlighted_text->append("</b>"); | 349 highlighted_text->append("</b>"); |
351 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(post))); | 350 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(post))); |
352 return true; | 351 return true; |
353 } | 352 } |
354 | 353 |
355 } // namespace internal | 354 } // namespace internal |
356 } // namespace drive | 355 } // namespace drive |
OLD | NEW |