Commit 0be72b85 authored by flackr@chromium.org's avatar flackr@chromium.org

The screen locker window manager refuses to map most windows over the screen...

The screen locker window manager refuses to map most windows over the screen locker layer. This is for good reason to be safe about not allowing content to show up on top. To be able to see the status area window over the lock screen we can override the window type to be TYPE_POPUP. This must only be done for the lock screen as it does not allow focus to this window which is used on the login screen but not allowed on the lock screen due to the GTK grab.

BUG=105572
TEST=Lock screen and check if status area is visible.


Review URL: http://codereview.chromium.org/8770012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113622 0039d316-1c4b-4281-b951-d872f2087c98
parent 2c337a67
...@@ -342,9 +342,9 @@ void WebUILoginView::InitStatusArea() { ...@@ -342,9 +342,9 @@ void WebUILoginView::InitStatusArea() {
widget_size.width(), widget_size.height()); widget_size.width(), widget_size.height());
// TODO(nkostylev|oshima): Make status area in the same window as // TODO(nkostylev|oshima): Make status area in the same window as
// |webui_login_| once RenderWidgetHostViewViews and compositor are // |webui_login_| once RenderWidgetHostViewViews and compositor are
// ready. // ready. This will also avoid having to override the status area
views::Widget::InitParams widget_params( // widget type for the lock screen.
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); views::Widget::InitParams widget_params(GetStatusAreaWidgetType());
widget_params.bounds = widget_bounds; widget_params.bounds = widget_bounds;
widget_params.transparent = true; widget_params.transparent = true;
widget_params.parent_widget = login_window_; widget_params.parent_widget = login_window_;
...@@ -352,10 +352,12 @@ void WebUILoginView::InitStatusArea() { ...@@ -352,10 +352,12 @@ void WebUILoginView::InitStatusArea() {
status_window_->Init(widget_params); status_window_->Init(widget_params);
#if defined(TOOLKIT_USES_GTK) #if defined(TOOLKIT_USES_GTK)
std::vector<int> params;
params.push_back(1); // Show while screen is locked.
chromeos::WmIpc::instance()->SetWindowType( chromeos::WmIpc::instance()->SetWindowType(
status_window_->GetNativeView(), status_window_->GetNativeView(),
chromeos::WM_IPC_WINDOW_CHROME_INFO_BUBBLE, chromeos::WM_IPC_WINDOW_CHROME_INFO_BUBBLE,
NULL); &params);
#endif #endif
views::View* contents_view = new RightAlignedView; views::View* contents_view = new RightAlignedView;
...@@ -364,6 +366,10 @@ void WebUILoginView::InitStatusArea() { ...@@ -364,6 +366,10 @@ void WebUILoginView::InitStatusArea() {
status_window_->Show(); status_window_->Show();
} }
views::Widget::InitParams::Type WebUILoginView::GetStatusAreaWidgetType() {
return views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
}
// WebUILoginView private: ----------------------------------------------------- // WebUILoginView private: -----------------------------------------------------
bool WebUILoginView::HandleContextMenu(const ContextMenuParams& params) { bool WebUILoginView::HandleContextMenu(const ContextMenuParams& params) {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "chrome/browser/tab_first_render_watcher.h" #include "chrome/browser/tab_first_render_watcher.h"
#include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h"
#include "content/browser/tab_contents/tab_contents_delegate.h" #include "content/browser/tab_contents/tab_contents_delegate.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_delegate.h"
class DOMView; class DOMView;
...@@ -94,6 +95,9 @@ class WebUILoginView : public views::WidgetDelegateView, ...@@ -94,6 +95,9 @@ class WebUILoginView : public views::WidgetDelegateView,
// Creates and adds the status area (separate window). // Creates and adds the status area (separate window).
virtual void InitStatusArea(); virtual void InitStatusArea();
// Returns the type to use for the status area widget.
virtual views::Widget::InitParams::Type GetStatusAreaWidgetType();
StatusAreaView* status_area_; StatusAreaView* status_area_;
// DOMView for rendering a webpage as a webui login. // DOMView for rendering a webpage as a webui login.
......
...@@ -192,4 +192,8 @@ void WebUIScreenLocker::OnTabMainFrameFirstRender() { ...@@ -192,4 +192,8 @@ void WebUIScreenLocker::OnTabMainFrameFirstRender() {
ScreenLockReady(); ScreenLockReady();
} }
views::Widget::InitParams::Type WebUIScreenLocker::GetStatusAreaWidgetType() {
return views::Widget::InitParams::TYPE_POPUP;
}
} // namespace chromeos } // namespace chromeos
...@@ -68,6 +68,7 @@ class WebUIScreenLocker : public WebUILoginView, ...@@ -68,6 +68,7 @@ class WebUIScreenLocker : public WebUILoginView,
// Overridden from WebUILoginView. // Overridden from WebUILoginView.
virtual void OnTabMainFrameFirstRender() OVERRIDE; virtual void OnTabMainFrameFirstRender() OVERRIDE;
virtual views::Widget::InitParams::Type GetStatusAreaWidgetType() OVERRIDE;
private: private:
virtual ~WebUIScreenLocker(); virtual ~WebUIScreenLocker();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment