OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 #include "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/glue/plugins/plugin_list.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
12 #include "base/string_split.h" | 12 #include "base/string_split.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "webkit/plugins/npapi/plugin_lib.h" | 15 #include "webkit/glue/plugins/plugin_lib.h" |
16 | |
17 namespace webkit { | |
18 namespace npapi { | |
19 | 16 |
20 namespace { | 17 namespace { |
21 | 18 |
22 void GetPluginCommonDirectory(std::vector<FilePath>* plugin_dirs, | 19 void GetPluginCommonDirectory(std::vector<FilePath>* plugin_dirs, |
23 bool user) { | 20 bool user) { |
24 // Note that there are no NSSearchPathDirectory constants for these | 21 // Note that there are no NSSearchPathDirectory constants for these |
25 // directories so we can't use Cocoa's NSSearchPathForDirectoriesInDomains(). | 22 // directories so we can't use Cocoa's NSSearchPathForDirectoriesInDomains(). |
26 // Interestingly, Safari hard-codes the location (see | 23 // Interestingly, Safari hard-codes the location (see |
27 // WebKit/WebKit/mac/Plugins/WebPluginDatabase.mm's +_defaultPlugInPaths). | 24 // WebKit/WebKit/mac/Plugins/WebPluginDatabase.mm's +_defaultPlugInPaths). |
28 FSRef ref; | 25 FSRef ref; |
(...skipping 29 matching lines...) Expand all Loading... |
58 return (components.size() >= 3 && | 55 return (components.size() >= 3 && |
59 base::StringToInt(components[2], &bugfix_version) && | 56 base::StringToInt(components[2], &bugfix_version) && |
60 bugfix_version < 6); | 57 bugfix_version < 6); |
61 } | 58 } |
62 | 59 |
63 return false; | 60 return false; |
64 } | 61 } |
65 | 62 |
66 } // namespace | 63 } // namespace |
67 | 64 |
| 65 namespace NPAPI |
| 66 { |
| 67 |
68 void PluginList::PlatformInit() { | 68 void PluginList::PlatformInit() { |
69 } | 69 } |
70 | 70 |
71 void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { | 71 void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { |
72 // Load from the user's area | 72 // Load from the user's area |
73 GetPluginCommonDirectory(plugin_dirs, true); | 73 GetPluginCommonDirectory(plugin_dirs, true); |
74 | 74 |
75 // Load from the machine-wide area | 75 // Load from the machine-wide area |
76 GetPluginCommonDirectory(plugin_dirs, false); | 76 GetPluginCommonDirectory(plugin_dirs, false); |
77 } | 77 } |
(...skipping 21 matching lines...) Expand all Loading... |
99 // encounter earlier must override plugins we encounter later) | 99 // encounter earlier must override plugins we encounter later) |
100 for (size_t i = 0; i < plugins->size(); ++i) { | 100 for (size_t i = 0; i < plugins->size(); ++i) { |
101 if ((*plugins)[i].path.BaseName() == info.path.BaseName()) { | 101 if ((*plugins)[i].path.BaseName() == info.path.BaseName()) { |
102 return false; // We already have a loaded plugin higher in the hierarchy. | 102 return false; // We already have a loaded plugin higher in the hierarchy. |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 } // namespace npapi | 109 } // namespace NPAPI |
110 } // namespace webkit | |
OLD | NEW |