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..c4987eeb8e5c5c55ff7aa2959de8682f65568c61 100644 |
--- a/chrome/browser/download/chrome_download_manager_delegate.cc |
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc |
@@ -392,6 +392,27 @@ bool ChromeDownloadManagerDelegate::ShouldOpenWithWebIntents( |
} |
#endif // defined(OS_CHROMEOS) |
+ // If QuickOffice extension is installed, use web intents to handle the |
+ // downloaded file. |
+ const char* kQuickOfficeExtensionId = "gbkeegbaiigmenfmjfclcdgdpimamgkj"; |
Steve McKay
2012/08/16 22:36:17
The five or so lines of code dedicated to figuring
|
+ ExtensionServiceInterface* extension_service = |
+ profile_->GetExtensionService(); |
+ if (extension_service && |
+ extension_service->GetInstalledExtension(kQuickOfficeExtensionId) && |
+ extension_service->IsExtensionEnabled(kQuickOfficeExtensionId)) { |
+ 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; |
+ } |
groby-ooo-7-16
2012/08/16 22:10:39
Can we actually unify that with the chromeos code?
|
+ } |
+ |
return false; |
} |