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/extensions/file_manager/event_router.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/event_router.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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 target_origin_url, | 678 target_origin_url, |
679 fileapi::kFileSystemTypeExternal); | 679 fileapi::kFileSystemTypeExternal); |
680 GURL target_directory_url = GURL(base_url.spec() + virtual_path.value()); | 680 GURL target_directory_url = GURL(base_url.spec() + virtual_path.value()); |
681 scoped_ptr<ListValue> args(new ListValue()); | 681 scoped_ptr<ListValue> args(new ListValue()); |
682 DictionaryValue* watch_info = new DictionaryValue(); | 682 DictionaryValue* watch_info = new DictionaryValue(); |
683 args->Append(watch_info); | 683 args->Append(watch_info); |
684 watch_info->SetString("directoryUrl", target_directory_url.spec()); | 684 watch_info->SetString("directoryUrl", target_directory_url.spec()); |
685 watch_info->SetString("eventType", | 685 watch_info->SetString("eventType", |
686 got_error ? kPathWatchError : kPathChanged); | 686 got_error ? kPathWatchError : kPathChanged); |
687 | 687 |
| 688 // TODO(mtomasz): Pass set of entries. http://crbug.com/157834 |
| 689 ListValue* watch_info_entries = new ListValue(); |
| 690 watch_info->Set("changedEntries", watch_info_entries); |
| 691 |
688 scoped_ptr<extensions::Event> event(new extensions::Event( | 692 scoped_ptr<extensions::Event> event(new extensions::Event( |
689 extensions::event_names::kOnDirectoryChanged, args.Pass())); | 693 extensions::event_names::kOnDirectoryChanged, args.Pass())); |
690 extensions::ExtensionSystem::Get(profile_)->event_router()-> | 694 extensions::ExtensionSystem::Get(profile_)->event_router()-> |
691 DispatchEventToExtension(extension_id, event.Pass()); | 695 DispatchEventToExtension(extension_id, event.Pass()); |
692 } | 696 } |
693 } | 697 } |
694 | 698 |
695 void EventRouter::DispatchMountEvent( | 699 void EventRouter::DispatchMountEvent( |
696 DiskMountManager::MountEvent event, | 700 DiskMountManager::MountEvent event, |
697 chromeos::MountError error_code, | 701 chromeos::MountError error_code, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 base::TimeDelta::FromSeconds(4)); | 840 base::TimeDelta::FromSeconds(4)); |
837 } else { | 841 } else { |
838 notifications_->HideNotification(DesktopNotifications::FORMAT_START, | 842 notifications_->HideNotification(DesktopNotifications::FORMAT_START, |
839 device_path); | 843 device_path); |
840 notifications_->ShowNotification(DesktopNotifications::FORMAT_FAIL, | 844 notifications_->ShowNotification(DesktopNotifications::FORMAT_FAIL, |
841 device_path); | 845 device_path); |
842 } | 846 } |
843 } | 847 } |
844 | 848 |
845 } // namespace file_manager | 849 } // namespace file_manager |
OLD | NEW |