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() {
widget_size.width(), widget_size.height());
// TODO(nkostylev|oshima): Make status area in the same window as
// |webui_login_| once RenderWidgetHostViewViews and compositor are
// ready.
views::Widget::InitParams widget_params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
// ready. This will also avoid having to override the status area
// widget type for the lock screen.
views::Widget::InitParams widget_params(GetStatusAreaWidgetType());
widget_params.bounds = widget_bounds;
widget_params.transparent = true;
widget_params.parent_widget = login_window_;
......@@ -352,10 +352,12 @@ void WebUILoginView::InitStatusArea() {
status_window_->Init(widget_params);
#if defined(TOOLKIT_USES_GTK)
std::vector<int> params;
params.push_back(1); // Show while screen is locked.
chromeos::WmIpc::instance()->SetWindowType(
status_window_->GetNativeView(),
chromeos::WM_IPC_WINDOW_CHROME_INFO_BUBBLE,
NULL);
&params);
#endif
views::View* contents_view = new RightAlignedView;
......@@ -364,6 +366,10 @@ void WebUILoginView::InitStatusArea() {
status_window_->Show();
}
views::Widget::InitParams::Type WebUILoginView::GetStatusAreaWidgetType() {
return views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
}
// WebUILoginView private: -----------------------------------------------------
bool WebUILoginView::HandleContextMenu(const ContextMenuParams& params) {
......
......@@ -14,6 +14,7 @@
#include "chrome/browser/tab_first_render_watcher.h"
#include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h"
#include "content/browser/tab_contents/tab_contents_delegate.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
class DOMView;
......@@ -94,6 +95,9 @@ class WebUILoginView : public views::WidgetDelegateView,
// Creates and adds the status area (separate window).
virtual void InitStatusArea();
// Returns the type to use for the status area widget.
virtual views::Widget::InitParams::Type GetStatusAreaWidgetType();
StatusAreaView* status_area_;
// DOMView for rendering a webpage as a webui login.
......
......@@ -192,4 +192,8 @@ void WebUIScreenLocker::OnTabMainFrameFirstRender() {
ScreenLockReady();
}
views::Widget::InitParams::Type WebUIScreenLocker::GetStatusAreaWidgetType() {
return views::Widget::InitParams::TYPE_POPUP;
}
} // namespace chromeos
......@@ -68,6 +68,7 @@ class WebUIScreenLocker : public WebUILoginView,
// Overridden from WebUILoginView.
virtual void OnTabMainFrameFirstRender() OVERRIDE;
virtual views::Widget::InitParams::Type GetStatusAreaWidgetType() OVERRIDE;
private:
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