| OLD | NEW |
| 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 #include "webkit/glue/plugins/plugin_list.h" | 5 #include "webkit/glue/plugins/plugin_list.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 // Return true if we're in debug-plugin-loading mode. | 14 // Return true if we're in debug-plugin-loading mode. |
| 15 bool DebugPluginLoading() { | 15 bool DebugPluginLoading() { |
| 16 static const wchar_t kDebugPluginLoading[] = L"debug-plugin-loading"; | 16 static const char kDebugPluginLoading[] = "debug-plugin-loading"; |
| 17 return CommandLine::ForCurrentProcess()->HasSwitch(kDebugPluginLoading); | 17 return CommandLine::ForCurrentProcess()->HasSwitch(kDebugPluginLoading); |
| 18 } | 18 } |
| 19 | 19 |
| 20 // We build up a list of files and mtimes so we can sort them. | 20 // We build up a list of files and mtimes so we can sort them. |
| 21 typedef std::pair<FilePath, base::Time> FileAndTime; | 21 typedef std::pair<FilePath, base::Time> FileAndTime; |
| 22 typedef std::vector<FileAndTime> FileTimeList; | 22 typedef std::vector<FileAndTime> FileTimeList; |
| 23 | 23 |
| 24 // Comparator used to sort by descending mtime then ascending filename. | 24 // Comparator used to sort by descending mtime then ascending filename. |
| 25 bool CompareTime(const FileAndTime& a, const FileAndTime& b) { | 25 bool CompareTime(const FileAndTime& a, const FileAndTime& b) { |
| 26 if (a.second == b.second) { | 26 if (a.second == b.second) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 // TODO(evanm): prefer the newest version of flash, etc. here? | 193 // TODO(evanm): prefer the newest version of flash, etc. here? |
| 194 | 194 |
| 195 if (DebugPluginLoading()) | 195 if (DebugPluginLoading()) |
| 196 LOG(ERROR) << "Using " << info.path.value(); | 196 LOG(ERROR) << "Using " << info.path.value(); |
| 197 | 197 |
| 198 return true; | 198 return true; |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace NPAPI | 201 } // namespace NPAPI |
| OLD | NEW |