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

Unified Diff: components/exo/shell_surface.cc

Issue 2248773002: Use MD-ash's auto hide behavior for arc++ windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add AUTO_HIDE_INVISIBLE mode for arc++. Created 4 years, 4 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: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 72f11c53c45055919cd6cbcda9f83703788b3c8d..ea38666e30b83fe0b4d5abcfd107743469075e6a 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -50,6 +50,14 @@ const struct Accelerator {
{ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN},
{ui::VKEY_F4, ui::EF_ALT_DOWN}};
+void UpdateShelfStateForFullscreenChange(views::Widget* widget) {
+ ash::wm::WindowState* window_state =
+ ash::wm::GetWindowState(widget->GetNativeWindow());
+ window_state->set_shelf_mode_in_fullscreen(
+ ash::wm::WindowState::SHELF_AUTO_HIDE_INVISIBLE);
+ ash::Shell::GetInstance()->UpdateShelfVisibility();
+}
+
class CustomFrameView : public views::NonClientFrameView {
public:
explicit CustomFrameView(views::Widget* widget) : widget_(widget) {}
@@ -118,6 +126,7 @@ class CustomWindowStateDelegate : public ash::wm::WindowStateDelegate,
if (widget_) {
bool enter_fullscreen = !window_state->IsFullscreen();
widget_->SetFullscreen(enter_fullscreen);
+ UpdateShelfStateForFullscreenChange(widget_);
}
return true;
}
@@ -390,6 +399,7 @@ void ShellSurface::SetFullscreen(bool fullscreen) {
// state doesn't change.
ScopedConfigure scoped_configure(this, true);
widget_->SetFullscreen(fullscreen);
+ UpdateShelfStateForFullscreenChange(widget_);
}
void ShellSurface::SetPinned(bool pinned) {

Powered by Google App Engine
This is Rietveld 408576698