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

Unified Diff: chrome/browser/chromeos/drive/search_metadata.cc

Issue 103013004: Google drive forms should not appear in the "offline" tab of Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | google_apis/drive/gdata_wapi_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/search_metadata.cc
diff --git a/chrome/browser/chromeos/drive/search_metadata.cc b/chrome/browser/chromeos/drive/search_metadata.cc
index 8886356c04eecfa8020742c3dfd06ebf8d39dc00..6b1d950724b3c54b47b0e52c51f5fd0522c297aa 100644
--- a/chrome/browser/chromeos/drive/search_metadata.cc
+++ b/chrome/browser/chromeos/drive/search_metadata.cc
@@ -14,6 +14,7 @@
#include "base/time/time.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "content/public/browser/browser_thread.h"
+#include "google_apis/drive/gdata_wapi_parser.h"
#include "net/base/escape.h"
using content::BrowserThread;
@@ -161,11 +162,24 @@ bool IsEligibleEntry(const ResourceEntry& entry,
return entry.shared_with_me();
if (options & SEARCH_METADATA_OFFLINE) {
- if (entry.file_specific_info().is_hosted_document())
- return true;
- FileCacheEntry cache_entry;
- it->GetCacheEntry(&cache_entry);
- return cache_entry.is_present();
+ if (entry.file_specific_info().is_hosted_document()) {
+ // Not all hosted documents are cached by Drive offline app.
+ // http://support.google.com/drive/bin/answer.py?hl=en&answer=1628467
+ switch (google_apis::ResourceEntry::GetEntryKindFromExtension(
+ entry.file_specific_info().document_extension())) {
+ case google_apis::ENTRY_KIND_DOCUMENT:
+ case google_apis::ENTRY_KIND_SPREADSHEET:
+ case google_apis::ENTRY_KIND_PRESENTATION:
+ case google_apis::ENTRY_KIND_DRAWING:
+ return true;
+ default:
+ return false;
+ }
+ } else {
+ FileCacheEntry cache_entry;
+ it->GetCacheEntry(&cache_entry);
+ return cache_entry.is_present();
+ }
}
// Exclude "drive", "drive/root", and "drive/other".
« no previous file with comments | « no previous file | google_apis/drive/gdata_wapi_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698