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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 target_origin_url, | 660 target_origin_url, |
661 fileapi::kFileSystemTypeExternal); | 661 fileapi::kFileSystemTypeExternal); |
662 GURL target_directory_url = GURL(base_url.spec() + virtual_path.value()); | 662 GURL target_directory_url = GURL(base_url.spec() + virtual_path.value()); |
663 scoped_ptr<ListValue> args(new ListValue()); | 663 scoped_ptr<ListValue> args(new ListValue()); |
664 DictionaryValue* watch_info = new DictionaryValue(); | 664 DictionaryValue* watch_info = new DictionaryValue(); |
665 args->Append(watch_info); | 665 args->Append(watch_info); |
666 watch_info->SetString("directoryUrl", target_directory_url.spec()); | 666 watch_info->SetString("directoryUrl", target_directory_url.spec()); |
667 watch_info->SetString("eventType", | 667 watch_info->SetString("eventType", |
668 got_error ? kPathWatchError : kPathChanged); | 668 got_error ? kPathWatchError : kPathChanged); |
669 | 669 |
670 // TODO(mtomasz): Pass set of entries. http://crbug.com/157834 | |
671 ListValue* watch_info_entries = new ListValue(); | |
672 watch_info->Set("changedEntries", watch_info_entries); | |
673 | |
674 scoped_ptr<extensions::Event> event(new extensions::Event( | 670 scoped_ptr<extensions::Event> event(new extensions::Event( |
675 extensions::event_names::kOnDirectoryChanged, args.Pass())); | 671 extensions::event_names::kOnDirectoryChanged, args.Pass())); |
676 extensions::ExtensionSystem::Get(profile_)->event_router()-> | 672 extensions::ExtensionSystem::Get(profile_)->event_router()-> |
677 DispatchEventToExtension(extension_id, event.Pass()); | 673 DispatchEventToExtension(extension_id, event.Pass()); |
678 } | 674 } |
679 } | 675 } |
680 | 676 |
681 void EventRouter::DispatchMountEvent( | 677 void EventRouter::DispatchMountEvent( |
682 DiskMountManager::MountEvent event, | 678 DiskMountManager::MountEvent event, |
683 chromeos::MountError error_code, | 679 chromeos::MountError error_code, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 base::TimeDelta::FromSeconds(4)); | 819 base::TimeDelta::FromSeconds(4)); |
824 } else { | 820 } else { |
825 notifications_->HideNotification(DesktopNotifications::FORMAT_START, | 821 notifications_->HideNotification(DesktopNotifications::FORMAT_START, |
826 device_path); | 822 device_path); |
827 notifications_->ShowNotification(DesktopNotifications::FORMAT_FAIL, | 823 notifications_->ShowNotification(DesktopNotifications::FORMAT_FAIL, |
828 device_path); | 824 device_path); |
829 } | 825 } |
830 } | 826 } |
831 | 827 |
832 } // namespace file_manager | 828 } // namespace file_manager |
OLD | NEW |