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

Side by Side Diff: chrome/browser/chromeos/file_manager/file_browser_handlers.cc

Issue 2898383002: [Extensions] Make Event::restrict_to_browser_context const. (Closed)
Patch Set: sync @tott Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 file_def->SetString("fileSystemName", iter->file_system_name); 401 file_def->SetString("fileSystemName", iter->file_system_name);
402 file_def->SetString("fileSystemRoot", iter->file_system_root_url); 402 file_def->SetString("fileSystemRoot", iter->file_system_root_url);
403 file_def->SetString("fileFullPath", 403 file_def->SetString("fileFullPath",
404 "/" + iter->full_path.AsUTF8Unsafe()); 404 "/" + iter->full_path.AsUTF8Unsafe());
405 file_def->SetBoolean("fileIsDirectory", iter->is_directory); 405 file_def->SetBoolean("fileIsDirectory", iter->is_directory);
406 file_entries->Append(std::move(file_def)); 406 file_entries->Append(std::move(file_def));
407 } 407 }
408 408
409 details->Set("entries", std::move(file_entries)); 409 details->Set("entries", std::move(file_entries));
410 event_args->Append(std::move(details)); 410 event_args->Append(std::move(details));
411 std::unique_ptr<extensions::Event> event(new extensions::Event( 411 auto event = base::MakeUnique<extensions::Event>(
412 extensions::events::FILE_BROWSER_HANDLER_ON_EXECUTE, 412 extensions::events::FILE_BROWSER_HANDLER_ON_EXECUTE,
413 "fileBrowserHandler.onExecute", std::move(event_args))); 413 "fileBrowserHandler.onExecute", std::move(event_args), profile_);
414 event->restrict_to_browser_context = profile_;
415 router->DispatchEventToExtension(extension_->id(), std::move(event)); 414 router->DispatchEventToExtension(extension_->id(), std::move(event));
416 415
417 ExecuteDoneOnUIThread(true); 416 ExecuteDoneOnUIThread(true);
418 } 417 }
419 418
420 void FileBrowserHandlerExecutor::SetupHandlerHostFileAccessPermissions( 419 void FileBrowserHandlerExecutor::SetupHandlerHostFileAccessPermissions(
421 FileDefinitionList* file_definition_list, 420 FileDefinitionList* file_definition_list,
422 const Extension* extension, 421 const Extension* extension,
423 int handler_pid) { 422 int handler_pid) {
424 const FileBrowserHandler* action = 423 const FileBrowserHandler* action =
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 if (common_handlers.empty()) 527 if (common_handlers.empty())
529 return FileBrowserHandlerList(); 528 return FileBrowserHandlerList();
530 } 529 }
531 } 530 }
532 531
533 return common_handlers; 532 return common_handlers;
534 } 533 }
535 534
536 } // namespace file_browser_handlers 535 } // namespace file_browser_handlers
537 } // namespace file_manager 536 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698