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/system_info_storage/storage_info_provide
r.h" | 5 #include "chrome/browser/extensions/api/system_info_storage/storage_info_provide
r.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/storage_monitor/storage_monitor.h" | 10 #include "chrome/browser/storage_monitor/storage_monitor.h" |
11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 | 14 |
15 using content::BrowserThread; | 15 using content::BrowserThread; |
16 using api::experimental_system_info_storage::StorageUnitInfo; | 16 using api::experimental_system_info_storage::StorageUnitInfo; |
17 | 17 |
18 namespace systeminfo { | 18 namespace systeminfo { |
19 | 19 |
20 const char kStorageTypeUnknown[] = "unknown"; | 20 const char kStorageTypeUnknown[] = "unknown"; |
21 const char kStorageTypeHardDisk[] = "harddisk"; | 21 const char kStorageTypeFixed[] = "fixed"; |
22 const char kStorageTypeRemovable[] = "removable"; | 22 const char kStorageTypeRemovable[] = "removable"; |
23 | 23 |
24 } // namespace systeminfo | 24 } // namespace systeminfo |
25 | 25 |
26 const int kDefaultPollingIntervalMs = 1000; | 26 const int kDefaultPollingIntervalMs = 1000; |
27 const char kWatchingTokenName[] = "_storage_info_watching_token_"; | 27 const char kWatchingTokenName[] = "_storage_info_watching_token_"; |
28 | 28 |
29 StorageInfoProvider::StorageInfoProvider() | 29 StorageInfoProvider::StorageInfoProvider() |
30 : observers_(new ObserverListThreadSafe<StorageInfoObserver>()), | 30 : observers_(new ObserverListThreadSafe<StorageInfoObserver>()), |
31 watching_interval_(kDefaultPollingIntervalMs) { | 31 watching_interval_(kDefaultPollingIntervalMs) { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 this, &StorageInfoProvider::CheckWatchedStorages); | 192 this, &StorageInfoProvider::CheckWatchedStorages); |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 void StorageInfoProvider::StopWatchingTimerOnUIThread() { | 196 void StorageInfoProvider::StopWatchingTimerOnUIThread() { |
197 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 197 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
198 watching_timer_.Stop(); | 198 watching_timer_.Stop(); |
199 } | 199 } |
200 | 200 |
201 } // namespace extensions | 201 } // namespace extensions |
OLD | NEW |