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

Side by Side Diff: chrome/browser/system_monitor/media_storage_util.h

Issue 10933114: Combine boolean MediaDeviceNotifications histograms to an enumerated histogram. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix style nit Created 8 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 | Annotate | Revision Log
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 // chrome::MediaStorageUtil provides information about storage devices attached 5 // chrome::MediaStorageUtil provides information about storage devices attached
6 // to the computer. 6 // to the computer.
7 7
8 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_STORAGE_UTIL_H_ 8 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_STORAGE_UTIL_H_
9 #define CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_STORAGE_UTIL_H_ 9 #define CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_STORAGE_UTIL_H_
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 static bool GetDeviceInfoFromPath(const FilePath& path, 68 static bool GetDeviceInfoFromPath(const FilePath& path,
69 std::string* device_id, 69 std::string* device_id,
70 string16* device_name, 70 string16* device_name,
71 FilePath* relative_path); 71 FilePath* relative_path);
72 72
73 // Get a FilePath for the given |device_id|. If the device isn't a mass 73 // Get a FilePath for the given |device_id|. If the device isn't a mass
74 // storage type, the FilePath will be empty. This does not check that 74 // storage type, the FilePath will be empty. This does not check that
75 // the device is connected. 75 // the device is connected.
76 static FilePath FindDevicePathById(const std::string& device_id); 76 static FilePath FindDevicePathById(const std::string& device_id);
77 77
78 // Record device information histogram for the given |device_uuid| and
79 // |device_name|. Set |mass_storage| to true, if the current device is a
80 // removable mass storage device else false.
81 static void RecordDeviceInfoHistogram(bool mass_storage,
82 const std::string& device_uuid,
83 const string16& device_name);
84
78 protected: 85 protected:
79 typedef bool (*GetDeviceInfoFromPathFunction)(const FilePath& path, 86 typedef bool (*GetDeviceInfoFromPathFunction)(const FilePath& path,
80 std::string* device_id, 87 std::string* device_id,
81 string16* device_name, 88 string16* device_name,
82 FilePath* relative_path); 89 FilePath* relative_path);
83 90
84 // Set the implementation of GetDeviceInfoFromPath for testing. 91 // Set the implementation of GetDeviceInfoFromPath for testing.
85 static void SetGetDeviceInfoFromPathFunctionForTesting( 92 static void SetGetDeviceInfoFromPathFunctionForTesting(
86 GetDeviceInfoFromPathFunction function); 93 GetDeviceInfoFromPathFunction function);
87 94
88 private: 95 private:
89 // All methods are static, this class should not be instantiated. 96 // All methods are static, this class should not be instantiated.
90 MediaStorageUtil(); 97 MediaStorageUtil();
91 98
92 DISALLOW_COPY_AND_ASSIGN(MediaStorageUtil); 99 DISALLOW_COPY_AND_ASSIGN(MediaStorageUtil);
93 }; 100 };
94 101
95 } // namespace chrome 102 } // namespace chrome
96 103
97 #endif // CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_STORAGE_UTIL_H_ 104 #endif // CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_STORAGE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698