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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 const base::FilePath& path) { | 574 const base::FilePath& path) { |
575 base::string16 plugin_name = path.LossyDisplayName(); | 575 base::string16 plugin_name = path.LossyDisplayName(); |
576 WebPluginInfo info; | 576 WebPluginInfo info; |
577 if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && | 577 if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && |
578 !info.name.empty()) { | 578 !info.name.empty()) { |
579 plugin_name = info.name; | 579 plugin_name = info.name; |
580 #if defined(OS_MACOSX) | 580 #if defined(OS_MACOSX) |
581 // Many plugins on the Mac have .plugin in the actual name, which looks | 581 // Many plugins on the Mac have .plugin in the actual name, which looks |
582 // terrible, so look for that and strip it off if present. | 582 // terrible, so look for that and strip it off if present. |
583 const std::string kPluginExtension = ".plugin"; | 583 const std::string kPluginExtension = ".plugin"; |
584 if (EndsWith(plugin_name, base::ASCIIToUTF16(kPluginExtension), true)) | 584 if (base::EndsWith(plugin_name, base::ASCIIToUTF16(kPluginExtension), true)) |
585 plugin_name.erase(plugin_name.length() - kPluginExtension.length()); | 585 plugin_name.erase(plugin_name.length() - kPluginExtension.length()); |
586 #endif // OS_MACOSX | 586 #endif // OS_MACOSX |
587 } | 587 } |
588 return plugin_name; | 588 return plugin_name; |
589 } | 589 } |
590 | 590 |
591 void PluginServiceImpl::GetPlugins(const GetPluginsCallback& callback) { | 591 void PluginServiceImpl::GetPlugins(const GetPluginsCallback& callback) { |
592 scoped_refptr<base::SingleThreadTaskRunner> target_task_runner( | 592 scoped_refptr<base::SingleThreadTaskRunner> target_task_runner( |
593 base::ThreadTaskRunnerHandle::Get()); | 593 base::ThreadTaskRunnerHandle::Get()); |
594 | 594 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 #endif | 870 #endif |
871 | 871 |
872 bool PluginServiceImpl::PpapiDevChannelSupported( | 872 bool PluginServiceImpl::PpapiDevChannelSupported( |
873 BrowserContext* browser_context, | 873 BrowserContext* browser_context, |
874 const GURL& document_url) { | 874 const GURL& document_url) { |
875 return content::GetContentClient()->browser()-> | 875 return content::GetContentClient()->browser()-> |
876 IsPluginAllowedToUseDevChannelAPIs(browser_context, document_url); | 876 IsPluginAllowedToUseDevChannelAPIs(browser_context, document_url); |
877 } | 877 } |
878 | 878 |
879 } // namespace content | 879 } // namespace content |
OLD | NEW |