| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/wm/workspace/phantom_window_controller.h" | 5 #include "ash/wm/workspace/phantom_window_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/coordinate_conversion.h" | 9 #include "ash/wm/coordinate_conversion.h" |
| 10 #include "ash/wm/shadow_types.h" | |
| 11 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
| 12 #include "ui/aura/client/screen_position_client.h" | 11 #include "ui/aura/client/screen_position_client.h" |
| 13 #include "ui/aura/root_window.h" | 12 #include "ui/aura/root_window.h" |
| 14 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 15 #include "ui/aura/window_delegate.h" | 14 #include "ui/aura/window_delegate.h" |
| 16 #include "ui/aura/window_observer.h" | 15 #include "ui/aura/window_observer.h" |
| 17 #include "ui/base/animation/slide_animation.h" | 16 #include "ui/base/animation/slide_animation.h" |
| 18 #include "ui/base/animation/tween.h" | 17 #include "ui/base/animation/tween.h" |
| 19 #include "ui/compositor/layer.h" | 18 #include "ui/compositor/layer.h" |
| 20 #include "ui/compositor/scoped_layer_animation_settings.h" | 19 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 21 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
| 22 #include "ui/gfx/screen.h" | 21 #include "ui/gfx/screen.h" |
| 23 #include "ui/gfx/skia_util.h" | 22 #include "ui/gfx/skia_util.h" |
| 23 #include "ui/views/corewm/shadow_types.h" |
| 24 #include "ui/views/painter.h" | 24 #include "ui/views/painter.h" |
| 25 #include "ui/views/view.h" | 25 #include "ui/views/view.h" |
| 26 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| 27 | 27 |
| 28 namespace ash { | 28 namespace ash { |
| 29 namespace internal { | 29 namespace internal { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 // Amount to inset from the bounds for EdgePainter. | 33 // Amount to inset from the bounds for EdgePainter. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 phantom_widget_->SetVisibilityChangedAnimationsEnabled(false); | 173 phantom_widget_->SetVisibilityChangedAnimationsEnabled(false); |
| 174 phantom_widget_->GetNativeWindow()->SetName("PhantomWindow"); | 174 phantom_widget_->GetNativeWindow()->SetName("PhantomWindow"); |
| 175 phantom_widget_->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow); | 175 phantom_widget_->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow); |
| 176 if (style_ == STYLE_SHADOW) { | 176 if (style_ == STYLE_SHADOW) { |
| 177 views::View* content_view = new views::View; | 177 views::View* content_view = new views::View; |
| 178 content_view->set_background( | 178 content_view->set_background( |
| 179 views::Background::CreateBackgroundPainter(true, new EdgePainter)); | 179 views::Background::CreateBackgroundPainter(true, new EdgePainter)); |
| 180 phantom_widget_->SetContentsView(content_view); | 180 phantom_widget_->SetContentsView(content_view); |
| 181 } else if (style_ == STYLE_DRAGGING) { | 181 } else if (style_ == STYLE_DRAGGING) { |
| 182 // Show shadow for the dragging window. | 182 // Show shadow for the dragging window. |
| 183 SetShadowType(phantom_widget_->GetNativeWindow(), SHADOW_TYPE_RECTANGULAR); | 183 SetShadowType(phantom_widget_->GetNativeWindow(), |
| 184 views::corewm::SHADOW_TYPE_RECTANGULAR); |
| 184 } | 185 } |
| 185 SetBoundsInternal(bounds); | 186 SetBoundsInternal(bounds); |
| 186 if (phantom_below_window_) | 187 if (phantom_below_window_) |
| 187 phantom_widget_->StackBelow(phantom_below_window_); | 188 phantom_widget_->StackBelow(phantom_below_window_); |
| 188 else | 189 else |
| 189 phantom_widget_->StackAbove(window_); | 190 phantom_widget_->StackAbove(window_); |
| 190 | 191 |
| 191 if (layer) { | 192 if (layer) { |
| 192 aura::Window* window = phantom_widget_->GetNativeWindow(); | 193 aura::Window* window = phantom_widget_->GetNativeWindow(); |
| 193 layer->SetVisible(true); | 194 layer->SetVisible(true); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 212 if (screen_position_client && | 213 if (screen_position_client && |
| 213 dst_display_.id() != gfx::Display::kInvalidDisplayID) { | 214 dst_display_.id() != gfx::Display::kInvalidDisplayID) { |
| 214 screen_position_client->SetBounds(window, bounds, dst_display_); | 215 screen_position_client->SetBounds(window, bounds, dst_display_); |
| 215 } else { | 216 } else { |
| 216 phantom_widget_->SetBounds(bounds); | 217 phantom_widget_->SetBounds(bounds); |
| 217 } | 218 } |
| 218 } | 219 } |
| 219 | 220 |
| 220 } // namespace internal | 221 } // namespace internal |
| 221 } // namespace ash | 222 } // namespace ash |
| OLD | NEW |