summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-27 23:13:19 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-27 23:13:19 +0000
commit2d75d4aa99411315831a5b4beaeeb46b236f634a (patch)
treee86a3f889132ad2326f0c7242074b42a52635789
parent3dbfbe511431842975af951be3c32604c76e1c1f (diff)
downloadchromium_src-2d75d4aa99411315831a5b4beaeeb46b236f634a.zip
chromium_src-2d75d4aa99411315831a5b4beaeeb46b236f634a.tar.gz
chromium_src-2d75d4aa99411315831a5b4beaeeb46b236f634a.tar.bz2
Enable the hung plugin detector on Win Aura.
Also enable the jumplist code which was similarly disabled. BUG=330424,330891 R=cpu@chromium.org Review URL: https://codereview.chromium.org/108413007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242648 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/hang_monitor/DEPS4
-rw-r--r--chrome/browser/hang_monitor/hung_plugin_action.cc9
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc26
-rw-r--r--chrome/browser/ui/views/frame/browser_view.h2
-rw-r--r--chrome/chrome_browser.gypi6
5 files changed, 27 insertions, 20 deletions
diff --git a/chrome/browser/hang_monitor/DEPS b/chrome/browser/hang_monitor/DEPS
new file mode 100644
index 0000000..a22d828
--- /dev/null
+++ b/chrome/browser/hang_monitor/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+ # This code is Windows only so it's ok to include this file.
+ "+chrome/browser/ui/views/simple_message_box_win.h",
+]
diff --git a/chrome/browser/hang_monitor/hung_plugin_action.cc b/chrome/browser/hang_monitor/hung_plugin_action.cc
index 89eeb4e..9d57dc4 100644
--- a/chrome/browser/hang_monitor/hung_plugin_action.cc
+++ b/chrome/browser/hang_monitor/hung_plugin_action.cc
@@ -8,7 +8,7 @@
#include "base/metrics/histogram.h"
#include "base/version.h"
-#include "chrome/browser/ui/simple_message_box.h"
+#include "chrome/browser/ui/views/simple_message_box_win.h"
#include "chrome/common/logging_chrome.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/common/webplugininfo.h"
@@ -113,8 +113,11 @@ bool HungPluginAction::OnHungWindowDetected(HWND hung_window,
HungWindowResponseCallback,
reinterpret_cast<ULONG_PTR>(this));
current_hung_plugin_window_ = hung_window;
- if (chrome::ShowMessageBox(NULL, title, message,
- chrome::MESSAGE_BOX_TYPE_QUESTION) ==
+ // We use chrome::NativeShowMessageBox instead of chrome::ShowMessageBox
+ // because the latter depends on UI-thread classes on Win Aura. See
+ // http://crbug.com/330424.
+ if (chrome::NativeShowMessageBox(
+ NULL, title, message, chrome::MESSAGE_BOX_TYPE_QUESTION) ==
chrome::MESSAGE_BOX_RESULT_YES) {
*action = HungWindowNotification::HUNG_WINDOW_TERMINATE_PROCESS;
} else {
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index a3c57e6..a95e9c6 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -140,16 +140,16 @@
#endif
#if defined(USE_AURA)
+#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/gfx/screen.h"
-#elif defined(OS_WIN) // !defined(USE_AURA)
-#include "chrome/browser/jumplist_win.h"
-#include "ui/views/widget/native_widget_win.h"
-#include "ui/views/win/scoped_fullscreen_visibility.h"
#endif
#if defined(OS_WIN)
#include "base/win/windows_version.h"
+#include "chrome/browser/jumplist_win.h"
+#include "ui/views/widget/native_widget_win.h"
+#include "ui/views/win/scoped_fullscreen_visibility.h"
#include "win8/util/win8_util.h"
#endif
@@ -419,7 +419,7 @@ BrowserView::BrowserView()
devtools_window_(NULL),
initialized_(false),
in_process_fullscreen_(false),
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN)
hung_window_detector_(&hung_plugin_action_),
ticker_(0),
#endif
@@ -438,7 +438,7 @@ BrowserView::~BrowserView() {
browser_->tab_strip_model()->RemoveObserver(this);
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN)
// Stop hung plugin monitoring.
ticker_.Stop();
ticker_.UnregisterTickHandler(&hung_window_detector_);
@@ -2006,7 +2006,7 @@ void BrowserView::InitViews() {
immersive_mode_controller_.get());
SetLayoutManager(browser_view_layout);
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN)
// Create a custom JumpList and add it to an observer of TabRestoreService
// so we can update the custom JumpList when a tab is added or removed.
if (JumpList::Enabled()) {
@@ -2044,7 +2044,7 @@ void BrowserView::LoadingAnimationCallback() {
}
void BrowserView::OnLoadCompleted() {
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN)
DCHECK(!jumplist_);
jumplist_ = new JumpList();
jumplist_->AddObserver(browser_->profile());
@@ -2364,7 +2364,7 @@ int BrowserView::GetCommandIDForAppCommandID(int app_command_id) const {
}
void BrowserView::InitHangMonitor() {
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN)
PrefService* pref_service = g_browser_process->local_state();
if (!pref_service)
return;
@@ -2373,8 +2373,14 @@ void BrowserView::InitHangMonitor() {
pref_service->GetInteger(prefs::kPluginMessageResponseTimeout);
int hung_plugin_detect_freq =
pref_service->GetInteger(prefs::kHungPluginDetectFrequency);
+#if defined(USE_AURA)
+ HWND window = GetWidget()->GetNativeView()->GetDispatcher()->host()->
+ GetAcceleratedWidget();
+#else
+ HWND window = GetWidget()->GetNativeView();
+#endif
if ((hung_plugin_detect_freq > 0) &&
- hung_window_detector_.Initialize(GetWidget()->GetNativeView(),
+ hung_window_detector_.Initialize(window,
plugin_message_response_timeout)) {
ticker_.set_tick_interval(hung_plugin_detect_freq);
ticker_.RegisterTickHandler(&hung_window_detector_);
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index 77dab20..3d64d49 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -682,7 +682,7 @@ class BrowserView : public BrowserWindow,
scoped_ptr<FullscreenExitBubbleViews> fullscreen_bubble_;
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN)
// This object is used to perform periodic actions in a worker
// thread. It is currently used to monitor hung plugin windows.
WorkerThreadTicker ticker_;
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 58a89de..e0439b8 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -2992,13 +2992,7 @@
['use_aura==1', {
'sources/': [
['exclude', '^browser/automation/testing_automation_provider_win.cc'],
- ['exclude', '^browser/hang_monitor/hung_plugin_action.cc'],
- ['exclude', '^browser/hang_monitor/hung_plugin_action.h'],
- ['exclude', '^browser/hang_monitor/hung_window_detector.cc'],
- ['exclude', '^browser/hang_monitor/hung_window_detector.h'],
['exclude', '^browser/icon_loader_linux.cc'],
- ['exclude', '^browser/jumplist_win.cc'],
- ['exclude', '^browser/jumplist_win.h'],
['exclude', '^browser/lifetime/application_lifetime_stub.cc'],
['exclude', '^browser/renderer_host/render_widget_host_view_views*'],
],