| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 5 #include <windows.h> |
| 6 | 6 |
| 7 #include "chrome/browser/hang_monitor/hung_plugin_action.h" | 7 #include "chrome/browser/hang_monitor/hung_plugin_action.h" |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/win/hwnd_util.h" | |
| 11 #include "chrome/browser/platform_util.h" | 10 #include "chrome/browser/platform_util.h" |
| 12 #include "chrome/common/logging_chrome.h" | 11 #include "chrome/common/logging_chrome.h" |
| 13 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 13 #include "ui/base/win/hwnd_util.h" |
| 14 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 14 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 15 | 15 |
| 16 HungPluginAction::HungPluginAction() : current_hung_plugin_window_(NULL) { | 16 HungPluginAction::HungPluginAction() : current_hung_plugin_window_(NULL) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 HungPluginAction::~HungPluginAction() { | 19 HungPluginAction::~HungPluginAction() { |
| 20 } | 20 } |
| 21 | 21 |
| 22 bool HungPluginAction::OnHungWindowDetected(HWND hung_window, | 22 bool HungPluginAction::OnHungWindowDetected(HWND hung_window, |
| 23 HWND top_level_window, | 23 HWND top_level_window, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 window_to_check, plugin_name)) { | 125 window_to_check, plugin_name)) { |
| 126 return true; | 126 return true; |
| 127 } | 127 } |
| 128 window_to_check = GetParent(window_to_check); | 128 window_to_check = GetParent(window_to_check); |
| 129 } | 129 } |
| 130 return false; | 130 return false; |
| 131 } | 131 } |
| 132 | 132 |
| 133 // static | 133 // static |
| 134 BOOL CALLBACK HungPluginAction::DismissMessageBox(HWND window, LPARAM ignore) { | 134 BOOL CALLBACK HungPluginAction::DismissMessageBox(HWND window, LPARAM ignore) { |
| 135 string16 class_name = app::win::GetClassName(window); | 135 string16 class_name = ui::GetClassName(window); |
| 136 // #32770 is the dialog window class which is the window class of | 136 // #32770 is the dialog window class which is the window class of |
| 137 // the message box being displayed. | 137 // the message box being displayed. |
| 138 if (class_name == L"#32770") { | 138 if (class_name == L"#32770") { |
| 139 EndDialog(window, IDNO); | 139 EndDialog(window, IDNO); |
| 140 return FALSE; | 140 return FALSE; |
| 141 } | 141 } |
| 142 return TRUE; | 142 return TRUE; |
| 143 } | 143 } |
| 144 | 144 |
| 145 // static | 145 // static |
| 146 void CALLBACK HungPluginAction::HungWindowResponseCallback(HWND target_window, | 146 void CALLBACK HungPluginAction::HungWindowResponseCallback(HWND target_window, |
| 147 UINT message, | 147 UINT message, |
| 148 ULONG_PTR data, | 148 ULONG_PTR data, |
| 149 LRESULT result) { | 149 LRESULT result) { |
| 150 HungPluginAction* instance = reinterpret_cast<HungPluginAction*>(data); | 150 HungPluginAction* instance = reinterpret_cast<HungPluginAction*>(data); |
| 151 DCHECK(NULL != instance); | 151 DCHECK(NULL != instance); |
| 152 if (NULL != instance) { | 152 if (NULL != instance) { |
| 153 instance->OnWindowResponsive(target_window); | 153 instance->OnWindowResponsive(target_window); |
| 154 } | 154 } |
| 155 } | 155 } |
| OLD | NEW |