Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: chrome/browser/chromeos/drive/search_metadata.cc

Issue 414203003: Remove unnecessary utilities from drive::util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/search_metadata_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/search_metadata_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698