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

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

Issue 541623002: Files.app: Remove scanning notification. (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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_DEVICE_EVENT_ROUTER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_DEVICE_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_DEVICE_EVENT_ROUTER_H_ 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_DEVICE_EVENT_ROUTER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
13 #include "chrome/browser/chromeos/file_manager/volume_manager_observer.h" 13 #include "chrome/browser/chromeos/file_manager/volume_manager_observer.h"
14 #include "chrome/common/extensions/api/file_manager_private.h" 14 #include "chrome/common/extensions/api/file_manager_private.h"
15 #include "chromeos/dbus/power_manager_client.h" 15 #include "chromeos/dbus/power_manager_client.h"
16 16
17 namespace file_manager { 17 namespace file_manager {
18 18
19 enum DeviceState { 19 enum DeviceState {
20 // Device is not being scanned and is not hard unplugged. 20 // Device is not being hard unplugged.
21 DEVICE_STATE_USUAL, 21 DEVICE_STATE_USUAL,
22 DEVICE_SCANNED, 22 // Device is hard unplugged.
23 DEVICE_SCANNED_AND_REPORTED,
24 DEVICE_HARD_UNPLUGGED, 23 DEVICE_HARD_UNPLUGGED,
24 // Device is hard unplugged and reported to the JavaScript side.
25 DEVICE_HARD_UNPLUGGED_AND_REPORTED 25 DEVICE_HARD_UNPLUGGED_AND_REPORTED
26 }; 26 };
27 27
28 // Event router for device events. 28 // Event router for device events.
29 class DeviceEventRouter : public VolumeManagerObserver, 29 class DeviceEventRouter : public VolumeManagerObserver,
30 public chromeos::PowerManagerClient::Observer { 30 public chromeos::PowerManagerClient::Observer {
31 public: 31 public:
32 DeviceEventRouter(); 32 DeviceEventRouter();
33 33
34 // |overriding_time_delta| overrides time delta of delayed tasks for testing 34 // |overriding_time_delta| overrides time delta of delayed tasks for testing
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 // Obtains device state of the device having |device_path|. 79 // Obtains device state of the device having |device_path|.
80 DeviceState GetDeviceState(const std::string& device_path) const; 80 DeviceState GetDeviceState(const std::string& device_path) const;
81 81
82 // Sets device state to the device having |device_path|. 82 // Sets device state to the device having |device_path|.
83 void SetDeviceState(const std::string& device_path, DeviceState state); 83 void SetDeviceState(const std::string& device_path, DeviceState state);
84 84
85 // Whther to use zero time delta for testing or not. 85 // Whther to use zero time delta for testing or not.
86 const base::TimeDelta resume_time_delta_; 86 const base::TimeDelta resume_time_delta_;
87 const base::TimeDelta startup_time_delta_; 87 const base::TimeDelta startup_time_delta_;
88 const base::TimeDelta scan_time_delta_;
89 88
90 // Whether the profile is starting up or not. 89 // Whether the profile is starting up or not.
91 bool is_starting_up_; 90 bool is_starting_up_;
92 91
93 // Whether the system is resuming or not. 92 // Whether the system is resuming or not.
94 bool is_resuming_; 93 bool is_resuming_;
95 94
96 // Map of device path and device state. 95 // Map of device path and device state.
97 std::map<std::string, DeviceState> device_states_; 96 std::map<std::string, DeviceState> device_states_;
98 97
99 // Thread checker. 98 // Thread checker.
100 base::ThreadChecker thread_checker_; 99 base::ThreadChecker thread_checker_;
101 100
102 // Note: This should remain the last member so it'll be destroyed and 101 // Note: This should remain the last member so it'll be destroyed and
103 // invalidate the weak pointers before any other members are destroyed. 102 // invalidate the weak pointers before any other members are destroyed.
104 base::WeakPtrFactory<DeviceEventRouter> weak_factory_; 103 base::WeakPtrFactory<DeviceEventRouter> weak_factory_;
105 DISALLOW_COPY_AND_ASSIGN(DeviceEventRouter); 104 DISALLOW_COPY_AND_ASSIGN(DeviceEventRouter);
106 }; 105 };
107 } // namespace file_manager 106 } // namespace file_manager
108 107
109 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_DEVICE_EVENT_ROUTER_H _ 108 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_DEVICE_EVENT_ROUTER_H _
OLDNEW
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | chrome/browser/chromeos/extensions/file_manager/device_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698