| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h" | 5 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/browser/chromeos/drive/file_system_util.h" | 11 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 12 #include "chrome/browser/chromeos/file_manager/app_id.h" | 12 #include "chrome/browser/chromeos/file_manager/app_id.h" |
| 13 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 13 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
| 14 #include "chrome/browser/chromeos/file_manager/open_with_browser.h" | 14 #include "chrome/browser/chromeos/file_manager/open_with_browser.h" |
| 15 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" | 15 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" |
| 16 #include "chrome/browser/extensions/event_router.h" | 16 #include "chrome/browser/extensions/event_router.h" |
| 17 #include "chrome/browser/extensions/extension_host.h" | 17 #include "chrome/browser/extensions/extension_host.h" |
| 18 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
| 19 #include "chrome/browser/extensions/extension_system.h" | 19 #include "chrome/browser/extensions/extension_system.h" |
| 20 #include "chrome/browser/extensions/extension_util.h" |
| 20 #include "chrome/browser/extensions/lazy_background_task_queue.h" | 21 #include "chrome/browser/extensions/lazy_background_task_queue.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/ui/browser_finder.h" | 23 #include "chrome/browser/ui/browser_finder.h" |
| 23 #include "chrome/common/extensions/api/file_browser_handlers/file_browser_handle
r.h" | 24 #include "chrome/common/extensions/api/file_browser_handlers/file_browser_handle
r.h" |
| 24 #include "chrome/common/extensions/background_info.h" | 25 #include "chrome/common/extensions/background_info.h" |
| 25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 26 #include "content/public/browser/child_process_security_policy.h" | 27 #include "content/public/browser/child_process_security_policy.h" |
| 27 #include "content/public/browser/render_process_host.h" | 28 #include "content/public/browser/render_process_host.h" |
| 28 #include "content/public/browser/site_instance.h" | 29 #include "content/public/browser/site_instance.h" |
| 29 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // We need case-insensitive matching, and pattern in the handler is already | 99 // We need case-insensitive matching, and pattern in the handler is already |
| 99 // in lower case. | 100 // in lower case. |
| 100 const GURL lowercase_url(EscapedUtf8ToLower(selected_file_url.spec())); | 101 const GURL lowercase_url(EscapedUtf8ToLower(selected_file_url.spec())); |
| 101 | 102 |
| 102 FileBrowserHandlerList results; | 103 FileBrowserHandlerList results; |
| 103 for (ExtensionSet::const_iterator iter = service->extensions()->begin(); | 104 for (ExtensionSet::const_iterator iter = service->extensions()->begin(); |
| 104 iter != service->extensions()->end(); | 105 iter != service->extensions()->end(); |
| 105 ++iter) { | 106 ++iter) { |
| 106 const Extension* extension = iter->get(); | 107 const Extension* extension = iter->get(); |
| 107 if (profile->IsOffTheRecord() && | 108 if (profile->IsOffTheRecord() && |
| 108 !service->IsIncognitoEnabled(extension->id())) | 109 !extension_util::IsIncognitoEnabled(extension->id(), service)) |
| 109 continue; | 110 continue; |
| 110 | 111 |
| 111 FileBrowserHandler::List* handler_list = | 112 FileBrowserHandler::List* handler_list = |
| 112 FileBrowserHandler::GetHandlers(extension); | 113 FileBrowserHandler::GetHandlers(extension); |
| 113 if (!handler_list) | 114 if (!handler_list) |
| 114 continue; | 115 continue; |
| 115 for (FileBrowserHandler::List::const_iterator handler_iter = | 116 for (FileBrowserHandler::List::const_iterator handler_iter = |
| 116 handler_list->begin(); | 117 handler_list->begin(); |
| 117 handler_iter != handler_list->end(); | 118 handler_iter != handler_list->end(); |
| 118 ++handler_iter) { | 119 ++handler_iter) { |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 common_handlers.erase(gallery_iter); | 547 common_handlers.erase(gallery_iter); |
| 547 else | 548 else |
| 548 common_handlers.erase(watch_iter); | 549 common_handlers.erase(watch_iter); |
| 549 } | 550 } |
| 550 | 551 |
| 551 return common_handlers; | 552 return common_handlers; |
| 552 } | 553 } |
| 553 | 554 |
| 554 } // namespace file_browser_handlers | 555 } // namespace file_browser_handlers |
| 555 } // namespace file_manager | 556 } // namespace file_manager |
| OLD | NEW |