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/extensions/api/sync_file_system/extension_sync_event_ob
server.h" | 5 #include "chrome/browser/extensions/api/sync_file_system/extension_sync_event_ob
server.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "chrome/browser/extensions/api/sync_file_system/sync_file_system_api_he
lpers.h" | 8 #include "chrome/browser/extensions/api/sync_file_system/sync_file_system_api_he
lpers.h" |
9 #include "chrome/browser/sync_file_system/sync_event_observer.h" | 9 #include "chrome/browser/sync_file_system/sync_event_observer.h" |
10 #include "chrome/browser/sync_file_system/sync_file_system_service.h" | 10 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 scoped_ptr<base::ListValue> params( | 78 scoped_ptr<base::ListValue> params( |
79 api::sync_file_system::OnServiceStatusChanged::Create(service_info)); | 79 api::sync_file_system::OnServiceStatusChanged::Create(service_info)); |
80 | 80 |
81 BroadcastOrDispatchEvent( | 81 BroadcastOrDispatchEvent( |
82 app_origin, | 82 app_origin, |
83 api::sync_file_system::OnServiceStatusChanged::kEventName, | 83 api::sync_file_system::OnServiceStatusChanged::kEventName, |
84 params.Pass()); | 84 params.Pass()); |
85 } | 85 } |
86 | 86 |
87 void ExtensionSyncEventObserver::OnFileSynced( | 87 void ExtensionSyncEventObserver::OnFileSynced( |
88 const fileapi::FileSystemURL& url, | 88 const storage::FileSystemURL& url, |
89 sync_file_system::SyncFileStatus status, | 89 sync_file_system::SyncFileStatus status, |
90 sync_file_system::SyncAction action, | 90 sync_file_system::SyncAction action, |
91 sync_file_system::SyncDirection direction) { | 91 sync_file_system::SyncDirection direction) { |
92 scoped_ptr<base::ListValue> params(new base::ListValue()); | 92 scoped_ptr<base::ListValue> params(new base::ListValue()); |
93 | 93 |
94 // For now we always assume events come only for files (not directories). | 94 // For now we always assume events come only for files (not directories). |
95 scoped_ptr<base::DictionaryValue> entry( | 95 scoped_ptr<base::DictionaryValue> entry( |
96 CreateDictionaryValueForFileSystemEntry( | 96 CreateDictionaryValueForFileSystemEntry( |
97 url, sync_file_system::SYNC_FILE_TYPE_FILE)); | 97 url, sync_file_system::SYNC_FILE_TYPE_FILE)); |
98 if (!entry) | 98 if (!entry) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 143 } |
144 | 144 |
145 template <> | 145 template <> |
146 void BrowserContextKeyedAPIFactory< | 146 void BrowserContextKeyedAPIFactory< |
147 ExtensionSyncEventObserver>::DeclareFactoryDependencies() { | 147 ExtensionSyncEventObserver>::DeclareFactoryDependencies() { |
148 DependsOn(sync_file_system::SyncFileSystemServiceFactory::GetInstance()); | 148 DependsOn(sync_file_system::SyncFileSystemServiceFactory::GetInstance()); |
149 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 149 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
150 } | 150 } |
151 | 151 |
152 } // namespace extensions | 152 } // namespace extensions |
OLD | NEW |