OLD | NEW |
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 "content/browser/plugin_service_impl.h" | 5 #include "content/browser/plugin_service_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 ++it) { | 540 ++it) { |
541 if (it->path == plugin_path) { | 541 if (it->path == plugin_path) { |
542 *info = *it; | 542 *info = *it; |
543 return true; | 543 return true; |
544 } | 544 } |
545 } | 545 } |
546 | 546 |
547 return false; | 547 return false; |
548 } | 548 } |
549 | 549 |
550 string16 PluginServiceImpl::GetPluginDisplayNameByPath( | 550 base::string16 PluginServiceImpl::GetPluginDisplayNameByPath( |
551 const base::FilePath& path) { | 551 const base::FilePath& path) { |
552 string16 plugin_name = path.LossyDisplayName(); | 552 base::string16 plugin_name = path.LossyDisplayName(); |
553 WebPluginInfo info; | 553 WebPluginInfo info; |
554 if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && | 554 if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && |
555 !info.name.empty()) { | 555 !info.name.empty()) { |
556 plugin_name = info.name; | 556 plugin_name = info.name; |
557 #if defined(OS_MACOSX) | 557 #if defined(OS_MACOSX) |
558 // Many plugins on the Mac have .plugin in the actual name, which looks | 558 // Many plugins on the Mac have .plugin in the actual name, which looks |
559 // terrible, so look for that and strip it off if present. | 559 // terrible, so look for that and strip it off if present. |
560 const std::string kPluginExtension = ".plugin"; | 560 const std::string kPluginExtension = ".plugin"; |
561 if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true)) | 561 if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true)) |
562 plugin_name.erase(plugin_name.length() - kPluginExtension.length()); | 562 plugin_name.erase(plugin_name.length() - kPluginExtension.length()); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 window, kPluginVersionAtomProperty, plugin_version); | 819 window, kPluginVersionAtomProperty, plugin_version); |
820 return true; | 820 return true; |
821 } | 821 } |
822 | 822 |
823 bool PluginServiceImpl::IsPluginWindow(HWND window) { | 823 bool PluginServiceImpl::IsPluginWindow(HWND window) { |
824 return gfx::GetClassName(window) == base::string16(kNativeWindowClassName); | 824 return gfx::GetClassName(window) == base::string16(kNativeWindowClassName); |
825 } | 825 } |
826 #endif | 826 #endif |
827 | 827 |
828 } // namespace content | 828 } // namespace content |
OLD | NEW |