| 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 "ash/mus/non_client_frame_controller.h" | 5 #include "ash/mus/non_client_frame_controller.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/common/ash_constants.h" | 13 #include "ash/common/ash_constants.h" |
| 14 #include "ash/common/ash_layout_constants.h" | 14 #include "ash/common/ash_layout_constants.h" |
| 15 #include "ash/common/frame/custom_frame_view_ash.h" | 15 #include "ash/common/frame/custom_frame_view_ash.h" |
| 16 #include "ash/common/wm/panels/panel_frame_view.h" | 16 #include "ash/common/wm/panels/panel_frame_view.h" |
| 17 #include "ash/common/wm_window.h" | 17 #include "ash/common/wm_window.h" |
| 18 #include "ash/mus/frame/custom_frame_view_mus.h" | 18 #include "ash/mus/frame/custom_frame_view_mus.h" |
| 19 #include "ash/mus/frame/detached_title_area_renderer.h" | 19 #include "ash/mus/frame/detached_title_area_renderer.h" |
| 20 #include "ash/mus/move_event_handler.h" | 20 #include "ash/mus/move_event_handler.h" |
| 21 #include "ash/mus/property_util.h" | 21 #include "ash/mus/property_util.h" |
| 22 #include "ash/mus/shadow.h" | |
| 23 #include "ash/mus/window_manager.h" | 22 #include "ash/mus/window_manager.h" |
| 24 #include "ash/mus/window_properties.h" | 23 #include "ash/mus/window_properties.h" |
| 25 #include "ash/shared/immersive_fullscreen_controller_delegate.h" | 24 #include "ash/shared/immersive_fullscreen_controller_delegate.h" |
| 26 #include "ash/wm/window_properties.h" | 25 #include "ash/wm/window_properties.h" |
| 27 #include "base/macros.h" | 26 #include "base/macros.h" |
| 28 #include "base/memory/ptr_util.h" | 27 #include "base/memory/ptr_util.h" |
| 29 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| 30 #include "services/ui/public/interfaces/window_manager.mojom.h" | 29 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 31 #include "ui/aura/client/aura_constants.h" | 30 #include "ui/aura/client/aura_constants.h" |
| 32 #include "ui/aura/client/transient_window_client.h" | 31 #include "ui/aura/client/transient_window_client.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 aura::Window* window = GetNativeView(); | 194 aura::Window* window = GetNativeView(); |
| 196 if (window->GetProperty(aura::client::kWindowTypeKey) == | 195 if (window->GetProperty(aura::client::kWindowTypeKey) == |
| 197 ui::mojom::WindowType::PANEL) | 196 ui::mojom::WindowType::PANEL) |
| 198 return new PanelFrameView(GetWidget(), PanelFrameView::FRAME_ASH); | 197 return new PanelFrameView(GetWidget(), PanelFrameView::FRAME_ASH); |
| 199 immersive_delegate_ = | 198 immersive_delegate_ = |
| 200 base::MakeUnique<ImmersiveFullscreenControllerDelegateMus>(GetWidget(), | 199 base::MakeUnique<ImmersiveFullscreenControllerDelegateMus>(GetWidget(), |
| 201 window); | 200 window); |
| 202 return new CustomFrameViewMus(GetWidget(), immersive_delegate_.get(), | 201 return new CustomFrameViewMus(GetWidget(), immersive_delegate_.get(), |
| 203 enable_immersive_); | 202 enable_immersive_); |
| 204 } | 203 } |
| 205 void InitNativeWidget(const views::Widget::InitParams& params) override { | |
| 206 views::NativeWidgetAura::InitNativeWidget(params); | |
| 207 // TODO(sky): shadow should be determined by window type and shadow type. | |
| 208 shadow_ = base::MakeUnique<Shadow>(); | |
| 209 shadow_->Init(Shadow::STYLE_INACTIVE); | |
| 210 aura::Window* window = GetNativeWindow(); | |
| 211 shadow_->Install(window); | |
| 212 window->layer()->Add(shadow_->layer()); | |
| 213 shadow_->layer()->parent()->StackAtBottom(shadow_->layer()); | |
| 214 } | |
| 215 void OnBoundsChanged(const gfx::Rect& old_bounds, | |
| 216 const gfx::Rect& new_bounds) override { | |
| 217 views::NativeWidgetAura::OnBoundsChanged(old_bounds, new_bounds); | |
| 218 if (shadow_) | |
| 219 shadow_->SetContentBounds(gfx::Rect(new_bounds.size())); | |
| 220 } | |
| 221 | 204 |
| 222 private: | 205 private: |
| 223 const bool remove_standard_frame_; | 206 const bool remove_standard_frame_; |
| 224 const bool enable_immersive_; | 207 const bool enable_immersive_; |
| 225 | 208 |
| 226 // The shadow, may be null. | |
| 227 std::unique_ptr<Shadow> shadow_; | |
| 228 | |
| 229 std::unique_ptr<MoveEventHandler> move_event_handler_; | 209 std::unique_ptr<MoveEventHandler> move_event_handler_; |
| 230 | 210 |
| 231 aura::WindowManagerClient* window_manager_client_; | 211 aura::WindowManagerClient* window_manager_client_; |
| 232 | 212 |
| 233 std::unique_ptr<ImmersiveFullscreenControllerDelegateMus> immersive_delegate_; | 213 std::unique_ptr<ImmersiveFullscreenControllerDelegateMus> immersive_delegate_; |
| 234 | 214 |
| 235 DISALLOW_COPY_AND_ASSIGN(WmNativeWidgetAura); | 215 DISALLOW_COPY_AND_ASSIGN(WmNativeWidgetAura); |
| 236 }; | 216 }; |
| 237 | 217 |
| 238 class ClientViewMus : public views::ClientView { | 218 class ClientViewMus : public views::ClientView { |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 void NonClientFrameController::OnWillRestackTransientChildAbove( | 434 void NonClientFrameController::OnWillRestackTransientChildAbove( |
| 455 aura::Window* parent, | 435 aura::Window* parent, |
| 456 aura::Window* transient_child) {} | 436 aura::Window* transient_child) {} |
| 457 | 437 |
| 458 void NonClientFrameController::OnDidRestackTransientChildAbove( | 438 void NonClientFrameController::OnDidRestackTransientChildAbove( |
| 459 aura::Window* parent, | 439 aura::Window* parent, |
| 460 aura::Window* transient_child) {} | 440 aura::Window* transient_child) {} |
| 461 | 441 |
| 462 } // namespace mus | 442 } // namespace mus |
| 463 } // namespace ash | 443 } // namespace ash |
| OLD | NEW |