Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(853)

Side by Side Diff: chrome/browser/ui/webui/flash_ui.cc

Issue 7648017: Make WebPluginInfo more generic (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/drag_util.mm ('k') | chrome/common/chrome_content_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/flash_ui.h" 5 #include "chrome/browser/ui/webui/flash_ui.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/threading/thread_restrictions.h" 9 #include "base/threading/thread_restrictions.h"
10 #include "base/timer.h" 10 #include "base/timer.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/crash_upload_list.h" 13 #include "chrome/browser/crash_upload_list.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 15 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
16 #include "chrome/browser/ui/webui/crashes_ui.h" 16 #include "chrome/browser/ui/webui/crashes_ui.h"
17 #include "chrome/common/chrome_version_info.h" 17 #include "chrome/common/chrome_version_info.h"
18 #include "chrome/common/jstemplate_builder.h" 18 #include "chrome/common/jstemplate_builder.h"
19 #include "chrome/common/url_constants.h" 19 #include "chrome/common/url_constants.h"
20 #include "content/browser/gpu/gpu_data_manager.h" 20 #include "content/browser/gpu/gpu_data_manager.h"
21 #include "content/browser/tab_contents/tab_contents.h" 21 #include "content/browser/tab_contents/tab_contents.h"
22 #include "content/browser/user_metrics.h" 22 #include "content/browser/user_metrics.h"
23 #include "grit/browser_resources.h" 23 #include "grit/browser_resources.h"
24 #include "grit/chromium_strings.h" 24 #include "grit/chromium_strings.h"
25 #include "grit/generated_resources.h" 25 #include "grit/generated_resources.h"
26 #include "grit/theme_resources.h" 26 #include "grit/theme_resources.h"
27 #include "ui/base/l10n/l10n_util.h" 27 #include "ui/base/l10n/l10n_util.h"
28 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
29 #include "webkit/plugins/npapi/plugin_list.h" 29 #include "webkit/plugins/npapi/plugin_list.h"
30 #include "webkit/plugins/npapi/webplugininfo.h" 30 #include "webkit/plugins/webplugininfo.h"
31 31
32 #if defined(OS_WIN) 32 #if defined(OS_WIN)
33 #include "base/win/windows_version.h" 33 #include "base/win/windows_version.h"
34 #endif 34 #endif
35 35
36 namespace { 36 namespace {
37 37
38 ChromeWebUIDataSource* CreateFlashUIHTMLSource() { 38 ChromeWebUIDataSource* CreateFlashUIHTMLSource() {
39 ChromeWebUIDataSource* source = 39 ChromeWebUIDataSource* source =
40 new ChromeWebUIDataSource(chrome::kChromeUIFlashHost); 40 new ChromeWebUIDataSource(chrome::kChromeUIFlashHost);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 os_label += " SP" + base::IntToString(os->service_pack().major); 215 os_label += " SP" + base::IntToString(os->service_pack().major);
216 if (os->service_pack().minor > 0) 216 if (os->service_pack().minor > 0)
217 os_label += "." + base::IntToString(os->service_pack().minor); 217 os_label += "." + base::IntToString(os->service_pack().minor);
218 if (os->architecture() == base::win::OSInfo::X64_ARCHITECTURE) 218 if (os->architecture() == base::win::OSInfo::X64_ARCHITECTURE)
219 os_label += " 64 bit"; 219 os_label += " 64 bit";
220 #endif 220 #endif
221 AddPair(list, l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS), os_label); 221 AddPair(list, l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS), os_label);
222 222
223 // Obtain the version of the Flash plugins. 223 // Obtain the version of the Flash plugins.
224 std::vector<webkit::npapi::WebPluginInfo> info_array; 224 std::vector<webkit::WebPluginInfo> info_array;
225 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( 225 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray(
226 GURL(), "application/x-shockwave-flash", false, NULL, &info_array, NULL); 226 GURL(), "application/x-shockwave-flash", false, NULL, &info_array, NULL);
227 string16 flash_version; 227 string16 flash_version;
228 if (info_array.empty()) { 228 if (info_array.empty()) {
229 AddPair(list, ASCIIToUTF16("Flash plugin"), "Disabled"); 229 AddPair(list, ASCIIToUTF16("Flash plugin"), "Disabled");
230 } else { 230 } else {
231 for (size_t i = 0; i < info_array.size(); ++i) { 231 for (size_t i = 0; i < info_array.size(); ++i) {
232 if (webkit::npapi::IsPluginEnabled(info_array[i])) { 232 if (webkit::IsPluginEnabled(info_array[i])) {
233 flash_version = info_array[i].version + ASCIIToUTF16(" ") + 233 flash_version = info_array[i].version + ASCIIToUTF16(" ") +
234 info_array[i].path.LossyDisplayName(); 234 info_array[i].path.LossyDisplayName();
235 if (i != 0) 235 if (i != 0)
236 flash_version += ASCIIToUTF16(" (not used)"); 236 flash_version += ASCIIToUTF16(" (not used)");
237 AddPair(list, ASCIIToUTF16("Flash plugin"), flash_version); 237 AddPair(list, ASCIIToUTF16("Flash plugin"), flash_version);
238 } 238 }
239 } 239 }
240 } 240 }
241 241
242 // Crash information. 242 // Crash information.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 // Set up the about:flash source. 333 // Set up the about:flash source.
334 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); 334 Profile* profile = Profile::FromBrowserContext(contents->browser_context());
335 profile->GetChromeURLDataManager()->AddDataSource(CreateFlashUIHTMLSource()); 335 profile->GetChromeURLDataManager()->AddDataSource(CreateFlashUIHTMLSource());
336 } 336 }
337 337
338 // static 338 // static
339 RefCountedMemory* FlashUI::GetFaviconResourceBytes() { 339 RefCountedMemory* FlashUI::GetFaviconResourceBytes() {
340 // Use the default icon for now. 340 // Use the default icon for now.
341 return NULL; 341 return NULL;
342 } 342 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/drag_util.mm ('k') | chrome/common/chrome_content_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698