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