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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/event_router.h

Issue 507293002: Enrich fileBrowserPrivate.onFileTransfersUpdated event to support displaying total number of jobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 void SendDriveFileTransferEvent(bool always); 188 void SendDriveFileTransferEvent(bool always);
189 189
190 // Manages the list of currently active Drive file transfer jobs. 190 // Manages the list of currently active Drive file transfer jobs.
191 struct DriveJobInfoWithStatus { 191 struct DriveJobInfoWithStatus {
192 DriveJobInfoWithStatus(); 192 DriveJobInfoWithStatus();
193 DriveJobInfoWithStatus(const drive::JobInfo& info, 193 DriveJobInfoWithStatus(const drive::JobInfo& info,
194 const std::string& status); 194 const std::string& status);
195 drive::JobInfo job_info; 195 drive::JobInfo job_info;
196 std::string status; 196 std::string status;
197 }; 197 };
198
199 // Sends onFileTranferUpdated to extensions if needed. The request is send
200 // after enough time has passed from the previous event.
201 void SendDriveFileTransferEventDelay(
hirono 2014/08/28 08:31:38 Could you integrate this method with SendDriveFile
iseki 2014/08/29 01:58:00 Done.
202 const DriveJobInfoWithStatus& job_info_with_status,
203 base::Time call_time,
204 bool is_delayed);
205
198 std::map<drive::JobID, DriveJobInfoWithStatus> drive_jobs_; 206 std::map<drive::JobID, DriveJobInfoWithStatus> drive_jobs_;
199 base::Time last_file_transfer_event_; 207 base::Time last_file_transfer_event_;
200 base::Time last_copy_progress_event_; 208 base::Time last_copy_progress_event_;
209 base::Time last_post_delayed_task_;
210
211 const base::TimeDelta startup_time_delta_;
201 212
202 WatcherMap file_watchers_; 213 WatcherMap file_watchers_;
203 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; 214 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
204 Profile* profile_; 215 Profile* profile_;
205 216
206 content::NotificationRegistrar notification_registrar_; 217 content::NotificationRegistrar notification_registrar_;
207 bool multi_user_window_manager_observer_registered_; 218 bool multi_user_window_manager_observer_registered_;
208 219
209 scoped_ptr<DeviceEventRouter> device_event_router_; 220 scoped_ptr<DeviceEventRouter> device_event_router_;
210 221
211 // Note: This should remain the last member so it'll be destroyed and 222 // Note: This should remain the last member so it'll be destroyed and
212 // invalidate the weak pointers before any other members are destroyed. 223 // invalidate the weak pointers before any other members are destroyed.
213 base::WeakPtrFactory<EventRouter> weak_factory_; 224 base::WeakPtrFactory<EventRouter> weak_factory_;
214 DISALLOW_COPY_AND_ASSIGN(EventRouter); 225 DISALLOW_COPY_AND_ASSIGN(EventRouter);
215 }; 226 };
216 227
217 } // namespace file_manager 228 } // namespace file_manager
218 229
219 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ 230 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698