Index: chrome/browser/download/chrome_download_manager_delegate.cc |
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc |
index 8ed2395f84d39bf0591f7fe31b747dfc334698c3..a6da0f21f4d2f2299fcbeff78c8a82bf3d658e41 100644 |
--- a/chrome/browser/download/chrome_download_manager_delegate.cc |
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc |
@@ -392,6 +392,35 @@ bool ChromeDownloadManagerDelegate::ShouldOpenWithWebIntents( |
} |
#endif // defined(OS_CHROMEOS) |
+ // If QuickOffice extension is installed, use web intents to handle the |
+ // downloaded file. |
+ const char* kQuickOfficeExtensionId = "gbkeegbaiigmenfmjfclcdgdpimamgkj"; |
+ ExtensionServiceInterface* extension_service = |
+ profile_->GetExtensionService(); |
+ |
+ const ExtensionSet* set = extension_service->extensions(); |
+ for (ExtensionSet::const_iterator it = set->begin(); |
+ it != set->end(); ++it) { |
+ LOG(INFO) << "Have extension " << (*it)->id(); |
+ } |
+ |
+ if (extension_service && |
+ extension_service->GetInstalledExtension(kQuickOfficeExtensionId) && |
+ extension_service->IsExtensionEnabled(kQuickOfficeExtensionId)) { |
+ LOG(INFO) << "Adding office type policy!"; |
+ if (mime_type == "application/msword" || |
+ mime_type == "application/vnd.ms-powerpoint" || |
+ mime_type == "application/vnd.ms-excel" || |
+ mime_type == "application/vnd.openxmlformats-officedocument." |
+ "wordprocessingml.document" || |
+ mime_type == "application/vnd.openxmlformats-officedocument." |
+ "presentationml.presentation" || |
+ mime_type == "application/vnd.openxmlformats-officedocument." |
+ "spreadsheetml.sheet") { |
+ return true; |
+ } |
+ } |
+ |
return false; |
} |