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

Side by Side Diff: components/exo/shell_surface.cc

Issue 2861523002: Do not disable minimize animation for maximized/fullscreened exo windows (Closed)
Patch Set: addressed comments Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/frame/custom_frame_view_ash.h" 9 #include "ash/frame/custom_frame_view_ash.h"
10 #include "ash/public/cpp/shell_window_ids.h" 10 #include "ash/public/cpp/shell_window_ids.h"
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 return gfx::Size(1, 1); 926 return gfx::Size(1, 1);
927 } 927 }
928 928
929 //////////////////////////////////////////////////////////////////////////////// 929 ////////////////////////////////////////////////////////////////////////////////
930 // ash::wm::WindowStateObserver overrides: 930 // ash::wm::WindowStateObserver overrides:
931 931
932 void ShellSurface::OnPreWindowStateTypeChange( 932 void ShellSurface::OnPreWindowStateTypeChange(
933 ash::wm::WindowState* window_state, 933 ash::wm::WindowState* window_state,
934 ash::wm::WindowStateType old_type) { 934 ash::wm::WindowStateType old_type) {
935 ash::wm::WindowStateType new_type = window_state->GetStateType(); 935 ash::wm::WindowStateType new_type = window_state->GetStateType();
936 if (old_type == ash::wm::WINDOW_STATE_TYPE_MINIMIZED ||
937 new_type == ash::wm::WINDOW_STATE_TYPE_MINIMIZED) {
938 return;
939 }
940
936 if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) || 941 if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) ||
937 ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) { 942 ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) {
938 // When transitioning in/out of maximized or fullscreen mode we need to 943 // When transitioning in/out of maximized or fullscreen mode we need to
939 // make sure we have a configure callback before we allow the default 944 // make sure we have a configure callback before we allow the default
940 // cross-fade animations. The configure callback provides a mechanism for 945 // cross-fade animations. The configure callback provides a mechanism for
941 // the client to inform us that a frame has taken the state change into 946 // the client to inform us that a frame has taken the state change into
942 // account and without this cross-fade animations are unreliable. 947 // account and without this cross-fade animations are unreliable.
943
944 // TODO(domlaskowski): For BoundsMode::CLIENT, the configure callback does 948 // TODO(domlaskowski): For BoundsMode::CLIENT, the configure callback does
945 // not yet support window state changes. See crbug.com/699746. 949 // not yet support window state changes. See crbug.com/699746.
946 if (configure_callback_.is_null() || bounds_mode_ == BoundsMode::CLIENT) 950 if (configure_callback_.is_null() || bounds_mode_ == BoundsMode::CLIENT)
947 scoped_animations_disabled_.reset(new ScopedAnimationsDisabled(this)); 951 scoped_animations_disabled_.reset(new ScopedAnimationsDisabled(this));
948 } 952 }
949 } 953 }
950 954
951 void ShellSurface::OnPostWindowStateTypeChange( 955 void ShellSurface::OnPostWindowStateTypeChange(
952 ash::wm::WindowState* window_state, 956 ash::wm::WindowState* window_state,
953 ash::wm::WindowStateType old_type) { 957 ash::wm::WindowStateType old_type) {
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 gfx::Point ShellSurface::GetMouseLocation() const { 1734 gfx::Point ShellSurface::GetMouseLocation() const {
1731 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1735 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1732 gfx::Point location = 1736 gfx::Point location =
1733 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1737 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1734 aura::Window::ConvertPointToTarget( 1738 aura::Window::ConvertPointToTarget(
1735 root_window, widget_->GetNativeWindow()->parent(), &location); 1739 root_window, widget_->GetNativeWindow()->parent(), &location);
1736 return location; 1740 return location;
1737 } 1741 }
1738 1742
1739 } // namespace exo 1743 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698