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

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

Issue 68543002: drive: Support offline delete (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move to drive/other and mark as deleted Created 7 years, 1 month 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
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 return entry.shared_with_me(); 111 return entry.shared_with_me();
112 112
113 if (options & SEARCH_METADATA_OFFLINE) { 113 if (options & SEARCH_METADATA_OFFLINE) {
114 if (entry.file_specific_info().is_hosted_document()) 114 if (entry.file_specific_info().is_hosted_document())
115 return true; 115 return true;
116 FileCacheEntry cache_entry; 116 FileCacheEntry cache_entry;
117 it->GetCacheEntry(&cache_entry); 117 it->GetCacheEntry(&cache_entry);
118 return cache_entry.is_present(); 118 return cache_entry.is_present();
119 } 119 }
120 120
121 // Exclude "drive", "drive/root", and "drive/other". 121 // Exclude "drive", "drive/root", "drive/other" and deleted entries.
122 if (it->GetID() == util::kDriveGrandRootLocalId || 122 if (it->GetID() == util::kDriveGrandRootLocalId ||
123 entry.parent_local_id() == util::kDriveGrandRootLocalId) { 123 entry.parent_local_id() == util::kDriveGrandRootLocalId ||
124 entry.deleted()) {
124 return false; 125 return false;
125 } 126 }
126 127
127 return true; 128 return true;
128 } 129 }
129 130
130 // Used to implement SearchMetadata. 131 // Used to implement SearchMetadata.
131 // Adds entry to the result when appropriate. 132 // Adds entry to the result when appropriate.
132 // In particular, if |query| is non-null, only adds files with the name matching 133 // In particular, if |query| is non-null, only adds files with the name matching
133 // the query. 134 // the query.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(pre))); 272 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(pre)));
272 highlighted_text->append("<b>"); 273 highlighted_text->append("<b>");
273 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(match))); 274 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(match)));
274 highlighted_text->append("</b>"); 275 highlighted_text->append("</b>");
275 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(post))); 276 highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(post)));
276 return true; 277 return true;
277 } 278 }
278 279
279 } // namespace internal 280 } // namespace internal
280 } // namespace drive 281 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698