Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: chrome/browser/ui/views/apps/native_app_window_views.cc

Issue 26427002: Add always-on-top property to app windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/apps/native_app_window_views.cc
diff --git a/chrome/browser/ui/views/apps/native_app_window_views.cc b/chrome/browser/ui/views/apps/native_app_window_views.cc
index 5c187109637ba9988507b0a59a33122d453d8775..e321c7751fe35a8bed5ec388f61bf52d7dbe9e95 100644
--- a/chrome/browser/ui/views/apps/native_app_window_views.cc
+++ b/chrome/browser/ui/views/apps/native_app_window_views.cc
@@ -169,6 +169,7 @@ void NativeAppWindowViews::InitializeDefaultWindow(
// TODO(erg): Conceptually, these are toplevel windows, but we theoretically
// could plumb context through to here in some cases.
init_params.top_level = true;
+ init_params.keep_on_top = create_params.always_on_top;
gfx::Rect window_bounds = create_params.bounds;
bool position_specified =
window_bounds.x() != INT_MIN && window_bounds.y() != INT_MIN;
@@ -410,14 +411,16 @@ void NativeAppWindowViews::FlashFrame(bool flash) {
}
bool NativeAppWindowViews::IsAlwaysOnTop() const {
- if (!shell_window_->window_type_is_panel())
- return false;
+ if (shell_window_->window_type_is_panel()) {
#if defined(USE_ASH)
return ash::wm::GetWindowState(window_->GetNativeWindow())->
panel_attached();
#else
return true;
#endif
+ } else {
+ return window_->IsAlwaysOnTop();
+ }
}
gfx::Insets NativeAppWindowViews::GetFrameInsets() const {
@@ -443,6 +446,11 @@ bool NativeAppWindowViews::IsVisible() const {
void NativeAppWindowViews::HideWithApp() {}
void NativeAppWindowViews::ShowWithApp() {}
+void NativeAppWindowViews::SetAlwaysOnTop(bool always_on_top) {
+ window_->SetAlwaysOnTop(always_on_top);
+ shell_window_->OnNativeWindowChanged();
+}
+
gfx::NativeView NativeAppWindowViews::GetHostView() const {
return window_->GetNativeView();
}
« no previous file with comments | « chrome/browser/ui/views/apps/native_app_window_views.h ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698