| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/pepper_flash_settings_manager.h" |
| 6 |
| 7 #include <vector> |
| 8 |
| 9 #include "chrome/browser/plugin_prefs.h" |
| 10 #include "content/public/browser/plugin_service.h" |
| 11 #include "googleurl/src/gurl.h" |
| 12 #include "webkit/plugins/plugin_constants.h" |
| 13 #include "webkit/plugins/webplugininfo.h" |
| 14 |
| 15 // static |
| 16 bool PepperFlashSettingsManager::IsPepperFlashInUse( |
| 17 PluginPrefs* plugin_prefs, |
| 18 webkit::WebPluginInfo* plugin_info) { |
| 19 if (!plugin_prefs) |
| 20 return false; |
| 21 |
| 22 content::PluginService* plugin_service = |
| 23 content::PluginService::GetInstance(); |
| 24 std::vector<webkit::WebPluginInfo> plugins; |
| 25 plugin_service->GetPluginInfoArray( |
| 26 GURL(), kFlashPluginSwfMimeType, false, &plugins, NULL); |
| 27 |
| 28 for (std::vector<webkit::WebPluginInfo>::iterator iter = plugins.begin(); |
| 29 iter != plugins.end(); ++iter) { |
| 30 if (webkit::IsPepperPlugin(*iter) && plugin_prefs->IsPluginEnabled(*iter)) { |
| 31 if (plugin_info) |
| 32 *plugin_info = *iter; |
| 33 return true; |
| 34 } |
| 35 } |
| 36 return false; |
| 37 } |
| OLD | NEW |