| 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 "chrome/browser/ui/webui/version_handler.h" | 5 #include "chrome/browser/ui/webui/version_handler.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/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 string16* profile_path_data) { | 122 string16* profile_path_data) { |
| 123 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 123 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 124 | 124 |
| 125 StringValue exec_path(*executable_path_data); | 125 StringValue exec_path(*executable_path_data); |
| 126 StringValue profile_path(*profile_path_data); | 126 StringValue profile_path(*profile_path_data); |
| 127 web_ui()->CallJavascriptFunction("returnFilePaths", exec_path, profile_path); | 127 web_ui()->CallJavascriptFunction("returnFilePaths", exec_path, profile_path); |
| 128 } | 128 } |
| 129 | 129 |
| 130 #if defined(ENABLE_PLUGINS) | 130 #if defined(ENABLE_PLUGINS) |
| 131 void VersionHandler::OnGotPlugins( | 131 void VersionHandler::OnGotPlugins( |
| 132 const std::vector<webkit::WebPluginInfo>& plugins) { | 132 const std::vector<content::WebPluginInfo>& plugins) { |
| 133 // Obtain the version of the first enabled Flash plugin. | 133 // Obtain the version of the first enabled Flash plugin. |
| 134 std::vector<webkit::WebPluginInfo> info_array; | 134 std::vector<content::WebPluginInfo> info_array; |
| 135 content::PluginService::GetInstance()->GetPluginInfoArray( | 135 content::PluginService::GetInstance()->GetPluginInfoArray( |
| 136 GURL(), kFlashPluginSwfMimeType, false, &info_array, NULL); | 136 GURL(), kFlashPluginSwfMimeType, false, &info_array, NULL); |
| 137 string16 flash_version = | 137 string16 flash_version = |
| 138 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN); | 138 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN); |
| 139 PluginPrefs* plugin_prefs = | 139 PluginPrefs* plugin_prefs = |
| 140 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get(); | 140 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get(); |
| 141 if (plugin_prefs) { | 141 if (plugin_prefs) { |
| 142 for (size_t i = 0; i < info_array.size(); ++i) { | 142 for (size_t i = 0; i < info_array.size(); ++i) { |
| 143 if (plugin_prefs->IsPluginEnabled(info_array[i])) { | 143 if (plugin_prefs->IsPluginEnabled(info_array[i])) { |
| 144 flash_version = info_array[i].version; | 144 flash_version = info_array[i].version; |
| 145 break; | 145 break; |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 StringValue arg(flash_version); | 150 StringValue arg(flash_version); |
| 151 web_ui()->CallJavascriptFunction("returnFlashVersion", arg); | 151 web_ui()->CallJavascriptFunction("returnFlashVersion", arg); |
| 152 } | 152 } |
| 153 #endif // defined(ENABLE_PLUGINS) | 153 #endif // defined(ENABLE_PLUGINS) |
| OLD | NEW |