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

Unified Diff: ash/wm/window_state.cc

Issue 27458002: Allow setting different hit test bounds overrides for mouse and touch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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: ash/wm/window_state.cc
diff --git a/ash/wm/window_state.cc b/ash/wm/window_state.cc
index 2afba08d68f104fde02c523099d592422e59e859..0b4e6239aa808bb0a32aa605fd13a9ff684f0b6c 100644
--- a/ash/wm/window_state.cc
+++ b/ash/wm/window_state.cc
@@ -28,6 +28,7 @@ bool WindowState::IsMaximizedOrFullscreenState(ui::WindowShowState show_state) {
WindowState::WindowState(aura::Window* window)
: window_(window),
+ fullscreen_type_(FULLSCREEN_TYPE_DEFAULT),
tracked_by_workspace_(true),
window_position_managed_(false),
bounds_changed_by_user_(false),
@@ -60,6 +61,13 @@ bool WindowState::IsFullscreen() const {
return GetShowState() == ui::SHOW_STATE_FULLSCREEN;
}
+bool WindowState::IsImmersiveFullscreen() const {
+ if (!IsFullscreen())
+ return false;
+ return fullscreen_type_ == FULLSCREEN_TYPE_IMMERSIVE_MINIMAL_CHROME ||
+ fullscreen_type_ == FULLSCREEN_TYPE_IMMERSIVE_NO_CHROME;
+}
+
bool WindowState::IsMaximizedOrFullscreen() const {
return IsMaximizedOrFullscreenState(GetShowState());
}
@@ -191,6 +199,15 @@ void WindowState::ClearRestoreBounds() {
window_->ClearProperty(aura::client::kRestoreBoundsKey);
}
+void WindowState::SetFullscreenType(FullscreenType type) {
+ if (!IsFullscreen() || fullscreen_type_ == type)
+ return;
+ FullscreenType old = fullscreen_type_;
+ fullscreen_type_ = type;
+ FOR_EACH_OBSERVER(WindowStateObserver, observer_list_,
+ OnWindowFullscreenTypeChanged(this, old));
+}
+
void WindowState::SetPreAutoManageWindowBounds(
const gfx::Rect& bounds) {
pre_auto_manage_window_bounds_.reset(new gfx::Rect(bounds));
@@ -219,6 +236,11 @@ void WindowState::OnWindowPropertyChanged(aura::Window* window,
DCHECK_EQ(window, window_);
if (key == aura::client::kShowStateKey) {
window_show_type_ = ToWindowShowType(GetShowState());
+ if (window_show_type_ != ash::wm::SHOW_TYPE_FULLSCREEN &&
+ window_show_type_ != ash::wm::SHOW_TYPE_MINIMIZED) {
+ fullscreen_type_ = FULLSCREEN_TYPE_DEFAULT;
+ }
+
ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old);
// TODO(oshima): Notify only when the state has changed.
// Doing so break a few tests now.
« no previous file with comments | « ash/wm/window_state.h ('k') | ash/wm/window_state_observer.h » ('j') | ui/aura/window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698