| OLD | NEW |
| 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/plugin_prefs.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 16 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 16 #include "chrome/browser/ui/webui/crashes_ui.h" | 17 #include "chrome/browser/ui/webui/crashes_ui.h" |
| 17 #include "chrome/common/chrome_version_info.h" | 18 #include "chrome/common/chrome_version_info.h" |
| 18 #include "chrome/common/jstemplate_builder.h" | 19 #include "chrome/common/jstemplate_builder.h" |
| 19 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 20 #include "content/browser/gpu/gpu_data_manager.h" | 21 #include "content/browser/gpu/gpu_data_manager.h" |
| 21 #include "content/browser/tab_contents/tab_contents.h" | 22 #include "content/browser/tab_contents/tab_contents.h" |
| 22 #include "content/browser/user_metrics.h" | 23 #include "content/browser/user_metrics.h" |
| 23 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 AddPair(list, l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS), os_label); | 222 AddPair(list, l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS), os_label); |
| 222 | 223 |
| 223 // Obtain the version of the Flash plugins. | 224 // Obtain the version of the Flash plugins. |
| 224 std::vector<webkit::npapi::WebPluginInfo> info_array; | 225 std::vector<webkit::npapi::WebPluginInfo> info_array; |
| 225 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( | 226 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( |
| 226 GURL(), "application/x-shockwave-flash", false, NULL, &info_array, NULL); | 227 GURL(), "application/x-shockwave-flash", false, NULL, &info_array, NULL); |
| 227 string16 flash_version; | 228 string16 flash_version; |
| 228 if (info_array.empty()) { | 229 if (info_array.empty()) { |
| 229 AddPair(list, ASCIIToUTF16("Flash plugin"), "Disabled"); | 230 AddPair(list, ASCIIToUTF16("Flash plugin"), "Disabled"); |
| 230 } else { | 231 } else { |
| 232 PluginPrefs* plugin_prefs = |
| 233 PluginPrefs::GetForProfile(web_ui_->GetProfile()); |
| 231 for (size_t i = 0; i < info_array.size(); ++i) { | 234 for (size_t i = 0; i < info_array.size(); ++i) { |
| 232 if (webkit::npapi::IsPluginEnabled(info_array[i])) { | 235 if (plugin_prefs->IsPluginEnabled(info_array[i])) { |
| 233 flash_version = info_array[i].version + ASCIIToUTF16(" ") + | 236 flash_version = info_array[i].version + ASCIIToUTF16(" ") + |
| 234 info_array[i].path.LossyDisplayName(); | 237 info_array[i].path.LossyDisplayName(); |
| 235 if (i != 0) | 238 if (i != 0) |
| 236 flash_version += ASCIIToUTF16(" (not used)"); | 239 flash_version += ASCIIToUTF16(" (not used)"); |
| 237 AddPair(list, ASCIIToUTF16("Flash plugin"), flash_version); | 240 AddPair(list, ASCIIToUTF16("Flash plugin"), flash_version); |
| 238 } | 241 } |
| 239 } | 242 } |
| 240 } | 243 } |
| 241 | 244 |
| 242 // Crash information. | 245 // Crash information. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // Set up the about:flash source. | 336 // Set up the about:flash source. |
| 334 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); | 337 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
| 335 profile->GetChromeURLDataManager()->AddDataSource(CreateFlashUIHTMLSource()); | 338 profile->GetChromeURLDataManager()->AddDataSource(CreateFlashUIHTMLSource()); |
| 336 } | 339 } |
| 337 | 340 |
| 338 // static | 341 // static |
| 339 RefCountedMemory* FlashUI::GetFaviconResourceBytes() { | 342 RefCountedMemory* FlashUI::GetFaviconResourceBytes() { |
| 340 // Use the default icon for now. | 343 // Use the default icon for now. |
| 341 return NULL; | 344 return NULL; |
| 342 } | 345 } |
| OLD | NEW |