diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 16:02:13 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 16:02:13 +0000 |
commit | f05510d090b6c33ad26d755f7fc9993623ed84da (patch) | |
tree | fa8111a617dc73a2ec59c5a0be9aba09d4c6acb7 | |
parent | 74ce26b81ea97faec420cf7c26ff7077be2a3868 (diff) | |
download | chromium_src-f05510d090b6c33ad26d755f7fc9993623ed84da.zip chromium_src-f05510d090b6c33ad26d755f7fc9993623ed84da.tar.gz chromium_src-f05510d090b6c33ad26d755f7fc9993623ed84da.tar.bz2 |
views: Partial implementation of always-on-top for NativeWidgetViews.
This fixes the touch-selection controller visibility on touchui with
views-desktop.
BUG=none
TEST=manually
Review URL: http://codereview.chromium.org/7780023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100696 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | views/widget/native_widget_views.cc | 8 | ||||
-rw-r--r-- | views/widget/native_widget_views.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/views/widget/native_widget_views.cc b/views/widget/native_widget_views.cc index 017c80c..da4d898 100644 --- a/views/widget/native_widget_views.cc +++ b/views/widget/native_widget_views.cc @@ -28,6 +28,7 @@ NativeWidgetViews::NativeWidgetViews(internal::NativeWidgetDelegate* delegate) view_(NULL), active_(false), minimized_(false), + always_on_top_(false), ALLOW_THIS_IN_INITIALIZER_LIST(close_widget_factory_(this)), hosting_widget_(NULL), ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET), @@ -98,6 +99,7 @@ void NativeWidgetViews::DispatchKeyEventPostIME(const KeyEvent& key) { void NativeWidgetViews::InitNativeWidget(const Widget::InitParams& params) { ownership_ = params.ownership; + always_on_top_ = params.keep_on_top; View* parent_view = NULL; if (params.parent_widget) { hosting_widget_ = params.parent_widget; @@ -339,6 +341,8 @@ void NativeWidgetViews::EnableClose(bool enable) { } void NativeWidgetViews::Show() { + if (always_on_top_) + MoveToTop(); view_->SetVisible(true); GetWidget()->SetInitialFocus(); } @@ -377,6 +381,10 @@ bool NativeWidgetViews::IsActive() const { } void NativeWidgetViews::SetAlwaysOnTop(bool on_top) { + always_on_top_ = on_top; + // This is not complete yet. At least |MoveToTop| will need to be updated to + // make sure a 'normal' window does not get on top of a window with + // |always_on_top_| set. NOTIMPLEMENTED(); } diff --git a/views/widget/native_widget_views.h b/views/widget/native_widget_views.h index ceaccc4..eaa2804 100644 --- a/views/widget/native_widget_views.h +++ b/views/widget/native_widget_views.h @@ -149,6 +149,9 @@ class VIEWS_EXPORT NativeWidgetViews : public internal::NativeWidgetPrivate { bool minimized_; + // Set when SetAlwaysOnTop is called, or keep_on_top is set during creation. + bool always_on_top_; + // The following factory is used for calls to close the NativeWidgetViews // instance. ScopedRunnableMethodFactory<NativeWidgetViews> close_widget_factory_; |