summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-06 15:54:08 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-06 15:54:08 +0000
commit3b69f0d5eb68490b06c4de6733dfa5d3acee9592 (patch)
treebcc305d6afa4f950e637cbfafad89b383b828a49
parent9d216138e5e3c607094b81fdd74328f274da2546 (diff)
downloadchromium_src-3b69f0d5eb68490b06c4de6733dfa5d3acee9592.zip
chromium_src-3b69f0d5eb68490b06c4de6733dfa5d3acee9592.tar.gz
chromium_src-3b69f0d5eb68490b06c4de6733dfa5d3acee9592.tar.bz2
Merge 131085 - Makes the hung renderer dialog and task manager always on top. This
way if you're in a maximized window you don't get kicked out. BUG=121197 TEST=none R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10006021 TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/10008051 git-svn-id: svn://svn.chromium.org/chrome/branches/1084/src@131131 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/dialog_style.h12
-rw-r--r--chrome/browser/ui/views/html_dialog_view.cc2
-rw-r--r--chrome/browser/ui/views/hung_renderer_view.cc5
-rw-r--r--chrome/browser/ui/webui/task_manager/task_manager_dialog.cc9
4 files changed, 22 insertions, 6 deletions
diff --git a/chrome/browser/ui/dialog_style.h b/chrome/browser/ui/dialog_style.h
index fd9774e..acf9d7e 100644
--- a/chrome/browser/ui/dialog_style.h
+++ b/chrome/browser/ui/dialog_style.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -18,19 +18,21 @@ enum DialogStyle {
// Deprecated, see BubbleWindow::Create().
// TODO(bshe): We probably need to use this style for certificate viewer
// HTML dialog.
- STYLE_XBAR = 1 << 0,
+ STYLE_XBAR = 1 << 0,
// Show throbber for slow rendering.
// Deprecated, see BubbleWindow::Create().
- STYLE_THROBBER = 1 << 1,
+ STYLE_THROBBER = 1 << 1,
// Content and title flush to edge, no padding.
- STYLE_FLUSH = 1 << 2,
+ STYLE_FLUSH = 1 << 2,
// Content flush to edge. Padding only on title.
- STYLE_FLUSH_CONTENT = 1 << 3
+ STYLE_FLUSH_CONTENT = 1 << 3,
+
#endif
+ STYLE_ALWAYS_ON_TOP = 1 << 4
};
#endif // CHROME_BROWSER_UI_DIALOG_STYLE_H_
diff --git a/chrome/browser/ui/views/html_dialog_view.cc b/chrome/browser/ui/views/html_dialog_view.cc
index 278ba03..c43fe9f 100644
--- a/chrome/browser/ui/views/html_dialog_view.cc
+++ b/chrome/browser/ui/views/html_dialog_view.cc
@@ -40,6 +40,8 @@ gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent,
HtmlDialogView* html_view = new HtmlDialogView(profile, browser, delegate);
views::Widget::CreateWindowWithParent(html_view, parent);
html_view->InitDialog();
+ if (style & STYLE_ALWAYS_ON_TOP)
+ html_view->GetWidget()->SetAlwaysOnTop(true);
html_view->GetWidget()->Show();
return html_view->GetWidget()->GetNativeWindow();
}
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc
index 594c5af..0ac7d2e 100644
--- a/chrome/browser/ui/views/hung_renderer_view.cc
+++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -564,6 +564,11 @@ void HungRendererDialogView::InitClass() {
static HungRendererDialogView* CreateHungRendererDialogView() {
HungRendererDialogView* cv = new HungRendererDialogView;
views::Widget::CreateWindow(cv);
+#if defined(USE_ASH)
+ // Force the window to be always on top so that it can float above maximized
+ // windows.
+ cv->GetWidget()->SetAlwaysOnTop(true);
+#endif
return cv;
}
diff --git a/chrome/browser/ui/webui/task_manager/task_manager_dialog.cc b/chrome/browser/ui/webui/task_manager/task_manager_dialog.cc
index 2a085f9..415a26c 100644
--- a/chrome/browser/ui/webui/task_manager/task_manager_dialog.cc
+++ b/chrome/browser/ui/webui/task_manager/task_manager_dialog.cc
@@ -195,11 +195,18 @@ void TaskManagerDialogImpl::OnCloseDialog() {
void TaskManagerDialogImpl::OpenHtmlDialog() {
Browser* browser = BrowserList::GetLastActive();
DCHECK(browser);
+#if defined(USE_ASH)
+ // Force the window to be always on top so that it can float above maximized
+ // windows.
+ DialogStyle dialog_style = STYLE_ALWAYS_ON_TOP;
+#else
+ DialogStyle dialog_style = STYLE_GENERIC;
+#endif
window_ = browser::ShowHtmlDialog(NULL,
browser->profile()->GetOriginalProfile(),
NULL,
this,
- STYLE_GENERIC);
+ dialog_style);
}
// ****************************************************