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

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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 void SendDriveFileTransferEvent(bool always); 195 void SendDriveFileTransferEvent(bool always);
196 196
197 // Manages the list of currently active Drive file transfer jobs. 197 // Manages the list of currently active Drive file transfer jobs.
198 struct DriveJobInfoWithStatus { 198 struct DriveJobInfoWithStatus {
199 DriveJobInfoWithStatus(); 199 DriveJobInfoWithStatus();
200 DriveJobInfoWithStatus(const drive::JobInfo& info, 200 DriveJobInfoWithStatus(const drive::JobInfo& info,
201 const std::string& status); 201 const std::string& status);
202 drive::JobInfo job_info; 202 drive::JobInfo job_info;
203 std::string status; 203 std::string status;
204 }; 204 };
205
206 // Sends onFileTranferUpdated to extensions if needed. The request is send
207 // after enough time has passed from the previous event.
208 void SendDriveFileTransferEventDelay(
209 const DriveJobInfoWithStatus& job_info_with_status,
210 base::Time call_time,
211 bool is_delayed);
212
205 std::map<drive::JobID, DriveJobInfoWithStatus> drive_jobs_; 213 std::map<drive::JobID, DriveJobInfoWithStatus> drive_jobs_;
206 base::Time last_file_transfer_event_; 214 base::Time last_file_transfer_event_;
207 base::Time last_copy_progress_event_; 215 base::Time last_copy_progress_event_;
216 base::Time last_post_delayed_task_;
217
218 const base::TimeDelta startup_time_delta_;
208 219
209 WatcherMap file_watchers_; 220 WatcherMap file_watchers_;
210 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; 221 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
211 Profile* profile_; 222 Profile* profile_;
212 223
213 content::NotificationRegistrar notification_registrar_; 224 content::NotificationRegistrar notification_registrar_;
214 bool multi_user_window_manager_observer_registered_; 225 bool multi_user_window_manager_observer_registered_;
215 226
216 // Note: This should remain the last member so it'll be destroyed and 227 // Note: This should remain the last member so it'll be destroyed and
217 // invalidate the weak pointers before any other members are destroyed. 228 // invalidate the weak pointers before any other members are destroyed.
218 base::WeakPtrFactory<EventRouter> weak_factory_; 229 base::WeakPtrFactory<EventRouter> weak_factory_;
219 DISALLOW_COPY_AND_ASSIGN(EventRouter); 230 DISALLOW_COPY_AND_ASSIGN(EventRouter);
220 }; 231 };
221 232
222 } // namespace file_manager 233 } // namespace file_manager
223 234
224 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ 235 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698