| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/common/wm/overview/scoped_transform_overview_window.h" | 5 #include "ash/common/wm/overview/scoped_transform_overview_window.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/wm/overview/scoped_overview_animation_settings.h" | 10 #include "ash/common/wm/overview/scoped_overview_animation_settings.h" |
| 11 #include "ash/common/wm/overview/scoped_overview_animation_settings_factory.h" | 11 #include "ash/common/wm/overview/scoped_overview_animation_settings_factory.h" |
| 12 #include "ash/common/wm/overview/window_selector_item.h" | 12 #include "ash/common/wm/overview/window_selector_item.h" |
| 13 #include "ash/common/wm/window_state.h" | 13 #include "ash/common/wm/window_state.h" |
| 14 #include "ash/common/wm_lookup.h" | 14 #include "ash/common/wm_lookup.h" |
| 15 #include "ash/common/wm_shell.h" | 15 #include "ash/common/wm_shell.h" |
| 16 #include "ash/common/wm_window.h" | 16 #include "ash/common/wm_window.h" |
| 17 #include "ash/common/wm_window_property.h" | |
| 18 #include "ash/root_window_controller.h" | 17 #include "ash/root_window_controller.h" |
| 19 #include "base/macros.h" | 18 #include "base/macros.h" |
| 20 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
| 21 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
| 22 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
| 22 #include "ui/aura/client/aura_constants.h" |
| 23 #include "ui/compositor/layer.h" | 23 #include "ui/compositor/layer.h" |
| 24 #include "ui/gfx/geometry/rect.h" | 24 #include "ui/gfx/geometry/rect.h" |
| 25 #include "ui/gfx/geometry/safe_integer_conversions.h" | 25 #include "ui/gfx/geometry/safe_integer_conversions.h" |
| 26 #include "ui/gfx/transform_util.h" | 26 #include "ui/gfx/transform_util.h" |
| 27 #include "ui/views/widget/widget.h" | 27 #include "ui/views/widget/widget.h" |
| 28 | 28 |
| 29 using WmWindows = std::vector<ash::WmWindow*>; | 29 using WmWindows = std::vector<ash::WmWindow*>; |
| 30 | 30 |
| 31 namespace ash { | 31 namespace ash { |
| 32 | 32 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 269 |
| 270 SkColor ScopedTransformOverviewWindow::GetTopColor() const { | 270 SkColor ScopedTransformOverviewWindow::GetTopColor() const { |
| 271 for (auto* window : GetTransientTreeIterator(window_)) { | 271 for (auto* window : GetTransientTreeIterator(window_)) { |
| 272 // If there are regular windows in the transient ancestor tree, all those | 272 // If there are regular windows in the transient ancestor tree, all those |
| 273 // windows are shown in the same overview item and the header is not masked. | 273 // windows are shown in the same overview item and the header is not masked. |
| 274 if (window != window_ && (window->GetType() == ui::wm::WINDOW_TYPE_NORMAL || | 274 if (window != window_ && (window->GetType() == ui::wm::WINDOW_TYPE_NORMAL || |
| 275 window->GetType() == ui::wm::WINDOW_TYPE_PANEL)) { | 275 window->GetType() == ui::wm::WINDOW_TYPE_PANEL)) { |
| 276 return SK_ColorTRANSPARENT; | 276 return SK_ColorTRANSPARENT; |
| 277 } | 277 } |
| 278 } | 278 } |
| 279 return window_->GetColorProperty(WmWindowProperty::TOP_VIEW_COLOR); | 279 return window_->aura_window()->GetProperty(aura::client::kTopViewColor); |
| 280 } | 280 } |
| 281 | 281 |
| 282 int ScopedTransformOverviewWindow::GetTopInset() const { | 282 int ScopedTransformOverviewWindow::GetTopInset() const { |
| 283 // Mirror window doesn't have insets. | 283 // Mirror window doesn't have insets. |
| 284 if (minimized_widget_) | 284 if (minimized_widget_) |
| 285 return 0; | 285 return 0; |
| 286 for (auto* window : GetTransientTreeIterator(window_)) { | 286 for (auto* window : GetTransientTreeIterator(window_)) { |
| 287 // If there are regular windows in the transient ancestor tree, all those | 287 // If there are regular windows in the transient ancestor tree, all those |
| 288 // windows are shown in the same overview item and the header is not masked. | 288 // windows are shown in the same overview item and the header is not masked. |
| 289 if (window != window_ && (window->GetType() == ui::wm::WINDOW_TYPE_NORMAL || | 289 if (window != window_ && (window->GetType() == ui::wm::WINDOW_TYPE_NORMAL || |
| 290 window->GetType() == ui::wm::WINDOW_TYPE_PANEL)) { | 290 window->GetType() == ui::wm::WINDOW_TYPE_PANEL)) { |
| 291 return 0; | 291 return 0; |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 return window_->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET); | 294 return window_->aura_window()->GetProperty(aura::client::kTopViewInset); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void ScopedTransformOverviewWindow::OnWindowDestroyed() { | 297 void ScopedTransformOverviewWindow::OnWindowDestroyed() { |
| 298 window_ = nullptr; | 298 window_ = nullptr; |
| 299 } | 299 } |
| 300 | 300 |
| 301 float ScopedTransformOverviewWindow::GetItemScale(const gfx::Size& source, | 301 float ScopedTransformOverviewWindow::GetItemScale(const gfx::Size& source, |
| 302 const gfx::Size& target, | 302 const gfx::Size& target, |
| 303 int top_view_inset, | 303 int top_view_inset, |
| 304 int title_height) { | 304 int title_height) { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 // In unit tests, the content view can have empty size. | 500 // In unit tests, the content view can have empty size. |
| 501 if (!preferred.IsEmpty()) { | 501 if (!preferred.IsEmpty()) { |
| 502 int inset = bounds.height() - preferred.height(); | 502 int inset = bounds.height() - preferred.height(); |
| 503 bounds.Inset(0, 0, 0, inset); | 503 bounds.Inset(0, 0, 0, inset); |
| 504 } | 504 } |
| 505 minimized_widget_->SetBounds(bounds); | 505 minimized_widget_->SetBounds(bounds); |
| 506 minimized_widget_->Show(); | 506 minimized_widget_->Show(); |
| 507 } | 507 } |
| 508 | 508 |
| 509 } // namespace ash | 509 } // namespace ash |
| OLD | NEW |