| OLD | NEW |
| 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 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 return gfx::Size(1, 1); | 915 return gfx::Size(1, 1); |
| 916 } | 916 } |
| 917 | 917 |
| 918 //////////////////////////////////////////////////////////////////////////////// | 918 //////////////////////////////////////////////////////////////////////////////// |
| 919 // ash::wm::WindowStateObserver overrides: | 919 // ash::wm::WindowStateObserver overrides: |
| 920 | 920 |
| 921 void ShellSurface::OnPreWindowStateTypeChange( | 921 void ShellSurface::OnPreWindowStateTypeChange( |
| 922 ash::wm::WindowState* window_state, | 922 ash::wm::WindowState* window_state, |
| 923 ash::wm::WindowStateType old_type) { | 923 ash::wm::WindowStateType old_type) { |
| 924 ash::wm::WindowStateType new_type = window_state->GetStateType(); | 924 ash::wm::WindowStateType new_type = window_state->GetStateType(); |
| 925 if (old_type == ash::wm::WINDOW_STATE_TYPE_MINIMIZED || |
| 926 new_type == ash::wm::WINDOW_STATE_TYPE_MINIMIZED) { |
| 927 return; |
| 928 } |
| 929 |
| 925 if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) || | 930 if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) || |
| 926 ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) { | 931 ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) { |
| 927 // When transitioning in/out of maximized or fullscreen mode we need to | 932 // When transitioning in/out of maximized or fullscreen mode we need to |
| 928 // make sure we have a configure callback before we allow the default | 933 // make sure we have a configure callback before we allow the default |
| 929 // cross-fade animations. The configure callback provides a mechanism for | 934 // cross-fade animations. The configure callback provides a mechanism for |
| 930 // the client to inform us that a frame has taken the state change into | 935 // the client to inform us that a frame has taken the state change into |
| 931 // account and without this cross-fade animations are unreliable. | 936 // account and without this cross-fade animations are unreliable. |
| 932 | |
| 933 // TODO(domlaskowski): For BoundsMode::CLIENT, the configure callback does | 937 // TODO(domlaskowski): For BoundsMode::CLIENT, the configure callback does |
| 934 // not yet support window state changes. See crbug.com/699746. | 938 // not yet support window state changes. See crbug.com/699746. |
| 935 if (configure_callback_.is_null() || bounds_mode_ == BoundsMode::CLIENT) | 939 if (configure_callback_.is_null() || bounds_mode_ == BoundsMode::CLIENT) |
| 936 scoped_animations_disabled_.reset(new ScopedAnimationsDisabled(this)); | 940 scoped_animations_disabled_.reset(new ScopedAnimationsDisabled(this)); |
| 937 } | 941 } |
| 938 } | 942 } |
| 939 | 943 |
| 940 void ShellSurface::OnPostWindowStateTypeChange( | 944 void ShellSurface::OnPostWindowStateTypeChange( |
| 941 ash::wm::WindowState* window_state, | 945 ash::wm::WindowState* window_state, |
| 942 ash::wm::WindowStateType old_type) { | 946 ash::wm::WindowStateType old_type) { |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 gfx::Point ShellSurface::GetMouseLocation() const { | 1723 gfx::Point ShellSurface::GetMouseLocation() const { |
| 1720 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); | 1724 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); |
| 1721 gfx::Point location = | 1725 gfx::Point location = |
| 1722 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 1726 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
| 1723 aura::Window::ConvertPointToTarget( | 1727 aura::Window::ConvertPointToTarget( |
| 1724 root_window, widget_->GetNativeWindow()->parent(), &location); | 1728 root_window, widget_->GetNativeWindow()->parent(), &location); |
| 1725 return location; | 1729 return location; |
| 1726 } | 1730 } |
| 1727 | 1731 |
| 1728 } // namespace exo | 1732 } // namespace exo |
| OLD | NEW |