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/files/file_util.h" | 8 #include "base/files/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" |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
398 scoped_ptr<extensions::Event> event(new extensions::Event( | 398 scoped_ptr<extensions::Event> event(new extensions::Event( |
399 "fileBrowserHandler.onExecute", event_args.Pass())); | 399 "fileBrowserHandler.onExecute", event_args.Pass())); |
400 event->restrict_to_browser_context = profile_; | 400 event->restrict_to_browser_context = profile_; |
401 router->DispatchEventToExtension(extension_->id(), event.Pass()); | 401 router->DispatchEventToExtension(extension_->id(), event.Pass()); |
402 | 402 |
403 ExecuteDoneOnUIThread(true); | 403 ExecuteDoneOnUIThread(true); |
404 } | 404 } |
405 | 405 |
406 void FileBrowserHandlerExecutor::SetupHandlerHostFileAccessPermissions( | 406 void FileBrowserHandlerExecutor::SetupHandlerHostFileAccessPermissions( |
407 FileDefinitionList* file_definition_list, | 407 FileDefinitionList* file_definition_list, |
408 const Extension* extension, | 408 const Extension* extension, |
mtomasz
2014/09/11 01:59:04
The |extension| argument seems unused, and it's co
dcheng
2014/09/11 02:04:07
I'm happy to do this cleanup, but would you mind i
| |
409 int handler_pid) { | 409 int handler_pid) { |
410 const FileBrowserHandler* action = FindFileBrowserHandlerForActionId( | 410 const FileBrowserHandler* action = |
411 extension_, action_id_); | 411 FindFileBrowserHandlerForActionId(extension_.get(), action_id_); |
412 for (FileDefinitionList::const_iterator iter = file_definition_list->begin(); | 412 for (FileDefinitionList::const_iterator iter = file_definition_list->begin(); |
413 iter != file_definition_list->end(); | 413 iter != file_definition_list->end(); |
414 ++iter) { | 414 ++iter) { |
415 if (!action) | 415 if (!action) |
416 continue; | 416 continue; |
417 if (action->CanRead()) { | 417 if (action->CanRead()) { |
418 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile( | 418 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile( |
419 handler_pid, iter->absolute_path); | 419 handler_pid, iter->absolute_path); |
420 } | 420 } |
421 if (action->CanWrite()) { | 421 if (action->CanWrite()) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 if (common_handlers.empty()) | 516 if (common_handlers.empty()) |
517 return FileBrowserHandlerList(); | 517 return FileBrowserHandlerList(); |
518 } | 518 } |
519 } | 519 } |
520 | 520 |
521 return common_handlers; | 521 return common_handlers; |
522 } | 522 } |
523 | 523 |
524 } // namespace file_browser_handlers | 524 } // namespace file_browser_handlers |
525 } // namespace file_manager | 525 } // namespace file_manager |
OLD | NEW |