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" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 extensions::EventRouter* event_router = | 373 extensions::EventRouter* event_router = |
374 extensions::ExtensionSystem::Get(profile_)->event_router(); | 374 extensions::ExtensionSystem::Get(profile_)->event_router(); |
375 if (!event_router) { | 375 if (!event_router) { |
376 ExecuteDoneOnUIThread(false); | 376 ExecuteDoneOnUIThread(false); |
377 return; | 377 return; |
378 } | 378 } |
379 | 379 |
380 SetupHandlerHostFileAccessPermissions( | 380 SetupHandlerHostFileAccessPermissions( |
381 file_list, extension_.get(), handler_pid); | 381 file_list, extension_.get(), handler_pid); |
382 | 382 |
383 scoped_ptr<ListValue> event_args(new ListValue()); | 383 scoped_ptr<base::ListValue> event_args(new base::ListValue()); |
384 event_args->Append(new base::StringValue(action_id_)); | 384 event_args->Append(new base::StringValue(action_id_)); |
385 DictionaryValue* details = new DictionaryValue(); | 385 base::DictionaryValue* details = new base::DictionaryValue(); |
386 event_args->Append(details); | 386 event_args->Append(details); |
387 // Get file definitions. These will be replaced with Entry instances by | 387 // Get file definitions. These will be replaced with Entry instances by |
388 // dispatchEvent() method from event_binding.js. | 388 // dispatchEvent() method from event_binding.js. |
389 ListValue* file_entries = new ListValue(); | 389 base::ListValue* file_entries = new base::ListValue(); |
390 details->Set("entries", file_entries); | 390 details->Set("entries", file_entries); |
391 for (FileDefinitionList::const_iterator iter = file_list.begin(); | 391 for (FileDefinitionList::const_iterator iter = file_list.begin(); |
392 iter != file_list.end(); | 392 iter != file_list.end(); |
393 ++iter) { | 393 ++iter) { |
394 DictionaryValue* file_def = new DictionaryValue(); | 394 base::DictionaryValue* file_def = new base::DictionaryValue(); |
395 file_entries->Append(file_def); | 395 file_entries->Append(file_def); |
396 file_def->SetString("fileSystemName", file_system_name); | 396 file_def->SetString("fileSystemName", file_system_name); |
397 file_def->SetString("fileSystemRoot", file_system_root.spec()); | 397 file_def->SetString("fileSystemRoot", file_system_root.spec()); |
398 base::FilePath root(FILE_PATH_LITERAL("/")); | 398 base::FilePath root(FILE_PATH_LITERAL("/")); |
399 base::FilePath full_path = root.Append(iter->virtual_path); | 399 base::FilePath full_path = root.Append(iter->virtual_path); |
400 file_def->SetString("fileFullPath", full_path.value()); | 400 file_def->SetString("fileFullPath", full_path.value()); |
401 file_def->SetBoolean("fileIsDirectory", iter->is_directory); | 401 file_def->SetBoolean("fileIsDirectory", iter->is_directory); |
402 } | 402 } |
403 | 403 |
404 scoped_ptr<extensions::Event> event(new extensions::Event( | 404 scoped_ptr<extensions::Event> event(new extensions::Event( |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 common_handlers.erase(gallery_iter); | 546 common_handlers.erase(gallery_iter); |
547 else | 547 else |
548 common_handlers.erase(watch_iter); | 548 common_handlers.erase(watch_iter); |
549 } | 549 } |
550 | 550 |
551 return common_handlers; | 551 return common_handlers; |
552 } | 552 } |
553 | 553 |
554 } // namespace file_browser_handlers | 554 } // namespace file_browser_handlers |
555 } // namespace file_manager | 555 } // namespace file_manager |
OLD | NEW |