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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 10830363: intents: Add conditional web intents dispatch for docs types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Kill superfluous logging. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/intents/web_intents_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | chrome/browser/intents/web_intents_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698