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

Side by Side Diff: base/mime_util.h

Issue 495002: Changes to base/ from a combination of FreeBSD and OpenBSD patches. (Closed)
Patch Set: minor tweaks Created 11 years 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 BASE_MIME_UTIL_H_ 5 #ifndef BASE_MIME_UTIL_H_
6 #define BASE_MIME_UTIL_H_ 6 #define BASE_MIME_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 class FilePath; 10 class FilePath;
11 11
12 namespace mime_util { 12 namespace mime_util {
13 13
14 // Gets the mime type for a file based on its filename. The file path does not 14 // Gets the mime type for a file based on its filename. The file path does not
15 // have to exist. Please note because it doesn't touch the disk, this does not 15 // have to exist. Please note because it doesn't touch the disk, this does not
16 // work for directories. 16 // work for directories.
17 // If the mime type is unknown, this will return application/octet-stream. 17 // If the mime type is unknown, this will return application/octet-stream.
18 std::string GetFileMimeType(const FilePath& filepath); 18 std::string GetFileMimeType(const FilePath& filepath);
19 19
20 // Get the mime type for a byte vector. 20 // Get the mime type for a byte vector.
21 std::string GetDataMimeType(const std::string& data); 21 std::string GetDataMimeType(const std::string& data);
22 22
23 #if defined(OS_LINUX) 23 #if defined(TOOLKIT_GTK)
24 // This detects the current GTK theme by calling gtk_settings_get_default(). 24 // This detects the current GTK theme by calling gtk_settings_get_default().
25 // It should only be executed on the UI thread and must be called before 25 // It should only be executed on the UI thread and must be called before
26 // GetMimeIcon(). 26 // GetMimeIcon().
27 void DetectGtkTheme(); 27 void DetectGtkTheme();
28 #endif 28 #endif
29 29
30 // Gets the file name for an icon given the mime type and icon pixel size. 30 // Gets the file name for an icon given the mime type and icon pixel size.
31 // Where an icon is a square image of |size| x |size|. 31 // Where an icon is a square image of |size| x |size|.
32 // This will try to find the closest matching icon. If that's not available, 32 // This will try to find the closest matching icon. If that's not available,
33 // then a generic icon, and finally an empty FilePath if all else fails. 33 // then a generic icon, and finally an empty FilePath if all else fails.
34 FilePath GetMimeIcon(const std::string& mime_type, size_t size); 34 FilePath GetMimeIcon(const std::string& mime_type, size_t size);
35 35
36 } // namespace mime_util 36 } // namespace mime_util
37 37
38 #endif // BASE_MIME_UTIL_H_ 38 #endif // BASE_MIME_UTIL_H_
OLDNEW
« base/message_loop.h ('K') | « base/message_loop_unittest.cc ('k') | base/native_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698