diff options
author | varkha <varkha@chromium.org> | 2015-06-29 15:35:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-29 22:37:23 +0000 |
commit | d99fa94f20bd74f7837ce3df44052ce2a707ab83 (patch) | |
tree | ac0d7c45a2263c50315ba530aa387fe106253d4d /extensions/browser/app_window | |
parent | 97236cc8f139bb6cba9ddd1a34a4889fe0b4a66f (diff) | |
download | chromium_src-d99fa94f20bd74f7837ce3df44052ce2a707ab83.zip chromium_src-d99fa94f20bd74f7837ce3df44052ce2a707ab83.tar.gz chromium_src-d99fa94f20bd74f7837ce3df44052ce2a707ab83.tar.bz2 |
Temporarily sets always-on-top property to off when another window is fullscreen
A chrome app window with always-on-top property (e.g. Hangouts app) stays on top of even the fullscreen window (e.g. a video playing on full screen) and it would be better to temporarily clear the always-on-top property while another window is in fullscreen mode.
We already track fullscreen mode in Chrome OS and we already have a concept of temporarily clearing always-on-top property when that very window enters fullscreen state. This CL wires those together so that always-on-top windows are pushed below a fullscreen window and reassert their always-on-top property when workspace is no longer in fullscreen state.
This only applies to Chrome OS, Windows case may be more difficult to get right.
BUG=450055
Review URL: https://codereview.chromium.org/1180673012
Cr-Commit-Position: refs/heads/master@{#336663}
Diffstat (limited to 'extensions/browser/app_window')
-rw-r--r-- | extensions/browser/app_window/app_window.cc | 11 | ||||
-rw-r--r-- | extensions/browser/app_window/app_window.h | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc index 4ebc38e..5a40efd 100644 --- a/extensions/browser/app_window/app_window.cc +++ b/extensions/browser/app_window/app_window.cc @@ -472,8 +472,7 @@ void AppWindow::OnNativeWindowChanged() { fullscreen_types_ = FULLSCREEN_TYPE_NONE; } - if (cached_always_on_top_) - UpdateNativeAlwaysOnTop(); // Same as in SetNativeWindowFullscreen. + RestoreAlwaysOnTop(); // Same as in SetNativeWindowFullscreen. #endif SaveWindowPosition(); @@ -703,6 +702,11 @@ void AppWindow::SetAlwaysOnTop(bool always_on_top) { bool AppWindow::IsAlwaysOnTop() const { return cached_always_on_top_; } +void AppWindow::RestoreAlwaysOnTop() { + if (cached_always_on_top_) + UpdateNativeAlwaysOnTop(); +} + void AppWindow::SetInterceptAllKeys(bool want_all_keys) { native_app_window_->SetInterceptAllKeys(want_all_keys); } @@ -815,8 +819,7 @@ void AppWindow::UpdateExtensionAppIcon() { void AppWindow::SetNativeWindowFullscreen() { native_app_window_->SetFullscreen(fullscreen_types_); - if (cached_always_on_top_) - UpdateNativeAlwaysOnTop(); + RestoreAlwaysOnTop(); } bool AppWindow::IntersectsWithTaskbar() const { diff --git a/extensions/browser/app_window/app_window.h b/extensions/browser/app_window/app_window.h index 10267f6..12eb78d 100644 --- a/extensions/browser/app_window/app_window.h +++ b/extensions/browser/app_window/app_window.h @@ -327,6 +327,9 @@ class AppWindow : public content::WebContentsDelegate, // may be false if the bit is silently switched off for security reasons. bool IsAlwaysOnTop() const; + // Restores the always-on-top property according to |cached_always_on_top_|. + void RestoreAlwaysOnTop(); + // Set whether the window should get even reserved keys (modulo platform // restrictions). void SetInterceptAllKeys(bool want_all_keys); |