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/nacl_ui.h" | 5 #include "chrome/browser/ui/webui/nacl_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // Obtain the version of the NaCl plugin. | 194 // Obtain the version of the NaCl plugin. |
195 std::vector<webkit::WebPluginInfo> info_array; | 195 std::vector<webkit::WebPluginInfo> info_array; |
196 PluginService::GetInstance()->GetPluginInfoArray( | 196 PluginService::GetInstance()->GetPluginInfoArray( |
197 GURL(), "application/x-nacl", false, &info_array, NULL); | 197 GURL(), "application/x-nacl", false, &info_array, NULL); |
198 string16 nacl_version; | 198 string16 nacl_version; |
199 string16 nacl_key = ASCIIToUTF16("NaCl plugin"); | 199 string16 nacl_key = ASCIIToUTF16("NaCl plugin"); |
200 if (info_array.empty()) { | 200 if (info_array.empty()) { |
201 AddPair(list.get(), nacl_key, ASCIIToUTF16("Disabled")); | 201 AddPair(list.get(), nacl_key, ASCIIToUTF16("Disabled")); |
202 } else { | 202 } else { |
203 PluginPrefs* plugin_prefs = | 203 PluginPrefs* plugin_prefs = |
204 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())); | 204 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get(); |
205 | 205 |
206 // Only the 0th plugin is used. | 206 // Only the 0th plugin is used. |
207 nacl_version = info_array[0].version + ASCIIToUTF16(" ") + | 207 nacl_version = info_array[0].version + ASCIIToUTF16(" ") + |
208 info_array[0].path.LossyDisplayName(); | 208 info_array[0].path.LossyDisplayName(); |
209 if (!plugin_prefs->IsPluginEnabled(info_array[0])) { | 209 if (!plugin_prefs->IsPluginEnabled(info_array[0])) { |
210 nacl_version += ASCIIToUTF16(" (Disabled in profile prefs)"); | 210 nacl_version += ASCIIToUTF16(" (Disabled in profile prefs)"); |
211 AddPair(list.get(), nacl_key, nacl_version); | 211 AddPair(list.get(), nacl_key, nacl_version); |
212 } | 212 } |
213 | 213 |
214 AddPair(list.get(), nacl_key, nacl_version); | 214 AddPair(list.get(), nacl_key, nacl_version); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 272 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
273 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); | 273 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); |
274 | 274 |
275 web_ui->AddMessageHandler(new NaClDOMHandler()); | 275 web_ui->AddMessageHandler(new NaClDOMHandler()); |
276 | 276 |
277 // Set up the about:nacl source. | 277 // Set up the about:nacl source. |
278 Profile* profile = Profile::FromWebUI(web_ui); | 278 Profile* profile = Profile::FromWebUI(web_ui); |
279 ChromeURLDataManager::AddDataSource(profile, CreateNaClUIHTMLSource()); | 279 ChromeURLDataManager::AddDataSource(profile, CreateNaClUIHTMLSource()); |
280 } | 280 } |
OLD | NEW |