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

Unified Diff: chrome/browser/hang_monitor/hung_plugin_action.cc

Issue 557893003: Stop using an atom to store plugin name/version on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/plugin_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/hang_monitor/hung_plugin_action.cc
diff --git a/chrome/browser/hang_monitor/hung_plugin_action.cc b/chrome/browser/hang_monitor/hung_plugin_action.cc
index 25659bf596bdf5e19a22cab05e45757d8c591d01..82142862ab0ad00c4cb6474dd4647c88ecf825b0 100644
--- a/chrome/browser/hang_monitor/hung_plugin_action.cc
+++ b/chrome/browser/hang_monitor/hung_plugin_action.cc
@@ -83,10 +83,9 @@ bool HungPluginAction::OnHungWindowDetected(HWND hung_window,
if (top_level_window_process_id != hung_window_process_id) {
base::string16 plugin_name;
base::string16 plugin_version;
- GetPluginNameAndVersion(hung_window,
- top_level_window_process_id,
- &plugin_name,
- &plugin_version);
+
+ content::PluginService::GetInstance()->GetPluginInfoFromWindow(
+ hung_window, &plugin_name, &plugin_version);
if (plugin_name.empty()) {
plugin_name = l10n_util::GetStringUTF16(IDS_UNKNOWN_PLUGIN_NAME);
} else if (kGTalkPluginName == plugin_name) {
@@ -160,30 +159,6 @@ void HungPluginAction::OnWindowResponsive(HWND window) {
}
}
-bool HungPluginAction::GetPluginNameAndVersion(HWND plugin_window,
- DWORD browser_process_id,
- base::string16* plugin_name,
- base::string16* plugin_version) {
- DCHECK(plugin_name);
- DCHECK(plugin_version);
- HWND window_to_check = plugin_window;
- while (NULL != window_to_check) {
- DWORD process_id = 0;
- GetWindowThreadProcessId(window_to_check, &process_id);
- if (process_id == browser_process_id) {
- // If we have reached a window the that belongs to the browser process
- // we have gone too far.
- return false;
- }
- if (content::PluginService::GetInstance()->GetPluginInfoFromWindow(
- window_to_check, plugin_name, plugin_version)) {
- return true;
- }
- window_to_check = GetParent(window_to_check);
- }
- return false;
-}
-
// static
BOOL CALLBACK HungPluginAction::DismissMessageBox(HWND window, LPARAM ignore) {
base::string16 class_name = gfx::GetClassName(window);
« no previous file with comments | « no previous file | content/browser/plugin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698