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

Unified Diff: chrome/browser/chromeos/file_manager/file_browser_handlers.cc

Issue 692793002: [unpacker] Allow only one ZIP handler at once: either the new or the old one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/chromeos/file_manager/file_tasks.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_manager/file_browser_handlers.cc
diff --git a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc
index e326fb017d3cab7b5e9753fd3794a663f2c83ace..7599c8baf7f72e3e400c6400dd26a00cfc12cccf 100644
--- a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc
+++ b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc
@@ -8,6 +8,7 @@
#include <set>
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/i18n/case_conversion.h"
#include "base/strings/utf_string_conversions.h"
@@ -22,6 +23,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h"
#include "chrome/common/extensions/api/file_manager_private.h"
+#include "chromeos/chromeos_switches.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/render_process_host.h"
@@ -34,6 +36,7 @@
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest_handlers/background_info.h"
+#include "extensions/common/url_pattern.h"
#include "net/base/escape.h"
#include "storage/browser/fileapi/file_system_context.h"
#include "storage/browser/fileapi/file_system_url.h"
@@ -132,8 +135,18 @@ FileBrowserHandlerList FindFileBrowserHandlersForURL(
const FileBrowserHandler* handler = handler_iter->get();
if (!handler->MatchesURL(lowercase_url))
continue;
-
- results.push_back(handler_iter->get());
+ // Filter out Files app from handling ZIP files via a handler, as it's
+ // now handled by new ZIP unpacker extension based on File System Provider
+ // API.
+ const URLPattern zip_pattern(URLPattern::SCHEME_EXTENSION,
+ "chrome-extension://*/*.zip");
+ if (handler->extension_id() == kFileManagerAppId &&
+ zip_pattern.MatchesURL(selected_file_url) &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kDisableNewZIPUnpacker)) {
+ continue;
+ }
+ results.push_back(handler);
}
}
return results;
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/file_tasks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698