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

Side by Side Diff: net/base/platform_mime_util_linux.cc

Issue 1134393002: Implement ChromeOS mime type extension mappings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to platform_mime_util_chromeos.cc Created 5 years, 7 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 #include "net/base/platform_mime_util.h" 5 #include "net/base/platform_mime_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 11
12 #if defined(OS_ANDROID) 12 #if defined(OS_ANDROID)
13 #include "net/android/network_library.h" 13 #include "net/android/network_library.h"
14 #else 14 #else
15 #include "base/nix/mime_util_xdg.h" 15 #include "base/nix/mime_util_xdg.h"
16 #endif 16 #endif
17 17
18 namespace net { 18 namespace net {
19 19
20 #if defined(OS_ANDROID) 20 #if defined(OS_ANDROID)
21 bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( 21 bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
22 const base::FilePath::StringType& ext, std::string* result) const { 22 const base::FilePath::StringType& ext, std::string* result) const {
23 return android::GetMimeTypeFromExtension(ext, result); 23 return android::GetMimeTypeFromExtension(ext, result);
24 } 24 }
25 #elif defined(OS_CHROMEOS)
eroman 2015/05/15 09:05:33 Actually, I think we need to remove this file from
yawano 2015/05/15 09:19:50 _linux.cc is included in chromeos build. Changing
eroman 2015/05/18 01:00:08 Yes that sounds like a good approach (use the same
yawano 2015/05/18 08:59:44 Done.
26 // Implemented in platform_mime_util_chromeos.cc.
25 #else 27 #else
26 bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( 28 bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
27 const base::FilePath::StringType& ext, std::string* result) const { 29 const base::FilePath::StringType& ext, std::string* result) const {
28 // TODO(thestig): This is a temporary hack until we can fix this 30 // TODO(thestig): This is a temporary hack until we can fix this
29 // properly in test shell / webkit. 31 // properly in test shell / webkit.
30 // We have to play dumb and not return application/x-perl here 32 // We have to play dumb and not return application/x-perl here
31 // to make the reload-subframe-object layout test happy. 33 // to make the reload-subframe-object layout test happy.
32 if (ext == "pl") 34 if (ext == "pl")
33 return false; 35 return false;
34 36
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 103
102 void PlatformMimeUtil::GetPlatformExtensionsForMimeType( 104 void PlatformMimeUtil::GetPlatformExtensionsForMimeType(
103 const std::string& mime_type, 105 const std::string& mime_type,
104 base::hash_set<base::FilePath::StringType>* extensions) const { 106 base::hash_set<base::FilePath::StringType>* extensions) const {
105 base::FilePath::StringType ext; 107 base::FilePath::StringType ext;
106 if (GetPreferredExtensionForMimeType(mime_type, &ext)) 108 if (GetPreferredExtensionForMimeType(mime_type, &ext))
107 extensions->insert(ext); 109 extensions->insert(ext);
108 } 110 }
109 111
110 } // namespace net 112 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698