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

Unified Diff: ash/wm/window_mirror_view.cc

Issue 2893643003: [mus+ash] Removes WmWindow from ash/wm/window_cycle_* (Closed)
Patch Set: [mus+ash] Removes WmWindow from ash/wm/window_cycle_* (nits) 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_mirror_view.h ('k') | ash/wm_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_mirror_view.cc
diff --git a/ash/wm/window_mirror_view.cc b/ash/wm/window_mirror_view.cc
index cab4c4206b89a04887154c4220b73bfbcab3298b..af58a6d2512d96b3383df06e5077984fb83b15d6 100644
--- a/ash/wm/window_mirror_view.cc
+++ b/ash/wm/window_mirror_view.cc
@@ -32,15 +32,15 @@ void EnsureAllChildrenAreVisible(ui::Layer* layer) {
} // namespace
-WindowMirrorView::WindowMirrorView(WmWindow* window) : target_(window) {
+WindowMirrorView::WindowMirrorView(aura::Window* window) : target_(window) {
DCHECK(window);
}
WindowMirrorView::~WindowMirrorView() {
// Make sure |target_| has outlived |this|. See crbug.com/681207
- DCHECK(target_->aura_window()->layer());
+ DCHECK(target_->layer());
if (layer_owner_)
- target_->aura_window()->ClearProperty(aura::client::kMirroringEnabledKey);
+ target_->ClearProperty(aura::client::kMirroringEnabledKey);
}
gfx::Size WindowMirrorView::GetPreferredSize() const {
@@ -58,7 +58,7 @@ void WindowMirrorView::Layout() {
gfx::Transform transform;
gfx::Rect client_area_bounds = GetClientAreaBounds();
// Scale down if necessary.
- if (size() != target_->GetBounds().size()) {
+ if (size() != target_->bounds().size()) {
const float scale =
width() / static_cast<float>(client_area_bounds.width());
transform.Scale(scale, scale);
@@ -78,13 +78,10 @@ void WindowMirrorView::OnVisibleBoundsChanged() {
}
void WindowMirrorView::InitLayerOwner() {
- if (!layer_owner_) {
- target_->aura_window()->SetProperty(aura::client::kMirroringEnabledKey,
- true);
- }
+ if (!layer_owner_)
+ target_->SetProperty(aura::client::kMirroringEnabledKey, true);
- layer_owner_ =
- ::wm::MirrorLayers(target_->aura_window(), false /* sync_bounds */);
+ layer_owner_ = ::wm::MirrorLayers(target_, false /* sync_bounds */);
SetPaintToLayer();
layer()->Add(GetMirrorLayer());
@@ -92,7 +89,7 @@ void WindowMirrorView::InitLayerOwner() {
layer()->SetMasksToBounds(true);
// Some extra work is needed when the target window is minimized.
- if (target_->GetWindowState()->IsMinimized()) {
+ if (wm::GetWindowState(target_)->IsMinimized()) {
GetMirrorLayer()->SetOpacity(1);
EnsureAllChildrenAreVisible(GetMirrorLayer());
}
@@ -105,14 +102,14 @@ ui::Layer* WindowMirrorView::GetMirrorLayer() {
}
gfx::Rect WindowMirrorView::GetClientAreaBounds() const {
- int insets = target_->aura_window()->GetProperty(aura::client::kTopViewInset);
+ int insets = target_->GetProperty(aura::client::kTopViewInset);
if (insets > 0) {
- gfx::Rect bounds(target_->GetBounds().size());
+ gfx::Rect bounds(target_->bounds().size());
bounds.Inset(0, insets, 0, 0);
return bounds;
}
// The target window may not have a widget in unit tests.
- views::Widget* widget = GetInternalWidgetForWindow(target_->aura_window());
+ views::Widget* widget = GetInternalWidgetForWindow(target_);
if (!widget)
return gfx::Rect();
views::View* client_view = widget->client_view();
« no previous file with comments | « ash/wm/window_mirror_view.h ('k') | ash/wm_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698