Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / file_manager / file_tasks.cc
index 6b0f7a1..71004e8 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "apps/launcher.h"
 #include "base/bind.h"
-#include "base/command_line.h"
 #include "base/prefs/pref_service.h"
 #include "base/prefs/scoped_user_pref_update.h"
 #include "base/strings/stringprintf.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
 #include "chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h"
-#include "chrome/common/extensions/api/file_browser_private.h"
+#include "chrome/common/extensions/api/file_manager_private.h"
 #include "chrome/common/extensions/extension_constants.h"
 #include "chrome/common/pref_names.h"
-#include "chromeos/chromeos_switches.h"
 #include "extensions/browser/extension_host.h"
 #include "extensions/browser/extension_registry.h"
 #include "extensions/browser/extension_system.h"
 #include "extensions/browser/extension_util.h"
 #include "extensions/common/constants.h"
 #include "extensions/common/extension_set.h"
-#include "webkit/browser/fileapi/file_system_url.h"
+#include "storage/browser/fileapi/file_system_url.h"
 
 using extensions::Extension;
 using extensions::app_file_handler_util::FindFileHandlersForFiles;
-using fileapi::FileSystemURL;
+using storage::FileSystemURL;
 
 namespace file_manager {
 namespace file_tasks {
@@ -105,28 +103,6 @@ void KeepOnlyFileManagerInternalTasks(std::vector<FullTaskDescriptor>* tasks) {
   tasks->swap(filtered);
 }
 
-void ChooseSuitableGalleryHandler(std::vector<FullTaskDescriptor>* task_list) {
-  const bool disable_new_gallery =
-      base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
-          chromeos::switches::kFileManagerEnableNewGallery) == "false";
-  std::vector<FullTaskDescriptor>::iterator it = task_list->begin();
-  while (it != task_list->end()) {
-    if (disable_new_gallery) {
-      if (it->task_descriptor().app_id == kGalleryAppId)
-        it = task_list->erase(it);
-      else
-        ++it;
-    } else {
-      if (it->task_descriptor().app_id == kFileManagerAppId &&
-          it->task_descriptor().action_id == "gallery") {
-        it = task_list->erase(it);
-      } else {
-        ++it;
-      }
-    }
-  }
-}
-
 // Returns true if the given task is a handler by built-in apps like Files.app
 // itself or QuickOffice etc. They are used as the initial default app.
 bool IsFallbackFileHandler(const file_tasks::TaskDescriptor& task) {
@@ -309,7 +285,7 @@ bool ExecuteFileTask(Profile* profile,
     apps::LaunchPlatformAppWithFileHandler(
         profile, extension, task.action_id, paths);
     if (!done.is_null())
-      done.Run(extensions::api::file_browser_private::TASK_RESULT_MESSAGE_SENT);
+      done.Run(extensions::api::file_manager_private::TASK_RESULT_MESSAGE_SENT);
     return true;
   }
   NOTREACHED();
@@ -504,7 +480,6 @@ void FindAllTypesOfTasks(
   if (ContainsGoogleDocument(path_mime_set))
     KeepOnlyFileManagerInternalTasks(result_list);
 
-  ChooseSuitableGalleryHandler(result_list);
   ChooseAndSetDefaultTask(*profile->GetPrefs(), path_mime_set, result_list);
 }