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> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "services/ui/public/cpp/window_manager_delegate.h" | 27 #include "services/ui/public/cpp/window_manager_delegate.h" |
28 #include "services/ui/public/cpp/window_property.h" | 28 #include "services/ui/public/cpp/window_property.h" |
29 #include "services/ui/public/cpp/window_tree_client.h" | 29 #include "services/ui/public/cpp/window_tree_client.h" |
30 #include "services/ui/public/interfaces/window_manager.mojom.h" | 30 #include "services/ui/public/interfaces/window_manager.mojom.h" |
31 #include "services/ui/public/interfaces/window_tree_host.mojom.h" | 31 #include "services/ui/public/interfaces/window_tree_host.mojom.h" |
32 #include "ui/aura/layout_manager.h" | 32 #include "ui/aura/layout_manager.h" |
33 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
34 #include "ui/aura/window_tree_host.h" | 34 #include "ui/aura/window_tree_host.h" |
35 #include "ui/base/hit_test.h" | 35 #include "ui/base/hit_test.h" |
36 #include "ui/compositor/layer.h" | 36 #include "ui/compositor/layer.h" |
| 37 #include "ui/gfx/geometry/dip_util.h" |
37 #include "ui/gfx/geometry/vector2d.h" | 38 #include "ui/gfx/geometry/vector2d.h" |
38 #include "ui/views/mus/native_widget_mus.h" | 39 #include "ui/views/mus/native_widget_mus.h" |
39 #include "ui/views/widget/widget.h" | 40 #include "ui/views/widget/widget.h" |
40 | 41 |
41 namespace ash { | 42 namespace ash { |
42 namespace mus { | 43 namespace mus { |
43 namespace { | 44 namespace { |
44 | 45 |
| 46 void SatisfyCallback(const cc::SurfaceSequence& sequence) { |
| 47 fprintf(stderr, ">>>%s\n", __PRETTY_FUNCTION__); |
| 48 } |
| 49 |
| 50 void RequireCallback(const cc::SurfaceId& id, |
| 51 const cc::SurfaceSequence& sequence) { |
| 52 fprintf(stderr, ">>>%s\n", __PRETTY_FUNCTION__); |
| 53 } |
| 54 |
45 // LayoutManager associated with the window created by WindowTreeHost. Resizes | 55 // LayoutManager associated with the window created by WindowTreeHost. Resizes |
46 // all children of the parent to match the bounds of the parent. Additionally | 56 // all children of the parent to match the bounds of the parent. Additionally |
47 // handles sizing of a Shadow. | 57 // handles sizing of a Shadow. |
48 class ContentWindowLayoutManager : public aura::LayoutManager { | 58 class ContentWindowLayoutManager : public aura::LayoutManager { |
49 public: | 59 public: |
50 ContentWindowLayoutManager(aura::Window* window, Shadow* shadow) | 60 ContentWindowLayoutManager(aura::Window* window, Shadow* shadow) |
51 : window_(window), shadow_(shadow) { | 61 : window_(window), shadow_(shadow) { |
52 OnWindowResized(); | 62 OnWindowResized(); |
53 } | 63 } |
54 ~ContentWindowLayoutManager() override {} | 64 ~ContentWindowLayoutManager() override {} |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 widget_->UpdateWindowTitle(); | 467 widget_->UpdateWindowTitle(); |
458 widget_->non_client_view()->frame_view()->SchedulePaint(); | 468 widget_->non_client_view()->frame_view()->SchedulePaint(); |
459 } | 469 } |
460 } | 470 } |
461 | 471 |
462 void NonClientFrameController::OnWindowDestroyed(ui::Window* window) { | 472 void NonClientFrameController::OnWindowDestroyed(ui::Window* window) { |
463 window_->RemoveObserver(this); | 473 window_->RemoveObserver(this); |
464 window_ = nullptr; | 474 window_ = nullptr; |
465 } | 475 } |
466 | 476 |
| 477 void NonClientFrameController::OnChildWindowSurfaceCreated( |
| 478 ui::Window* window, |
| 479 const gfx::Size& size, |
| 480 float device_scale_factor, |
| 481 const cc::SurfaceId& surface_id, |
| 482 const cc::SurfaceSequence& surface_sequence) { |
| 483 //views::NativeWidgetMus* nwm = views::NativeWidgetMus::GetForWindow(window); |
| 484 //fprintf(stderr, ">>>>%s nwm: %p\n", __PRETTY_FUNCTION__, nwm); |
| 485 //if (nwm) { |
| 486 // gfx::Size size_in_dip = gfx::ConvertSizeToDIP(device_scale_factor, size); |
| 487 // nwm->GetNativeView()->layer()->SetShowSurface( |
| 488 // surface_id, base::Bind(&SatisfyCallback), base::Bind(&RequireCallback)
, |
| 489 // size, device_scale_factor, size_in_dip); |
| 490 |
| 491 // fprintf(stderr, |
| 492 // ">>>%s size: (%d, %d), device_scale_factor: %f surface_id: %s " |
| 493 // "window: %p \n", |
| 494 // __PRETTY_FUNCTION__, size.width(), size.height(), |
| 495 // device_scale_factor, surface_id.ToString().c_str(), window); |
| 496 //} |
| 497 } |
| 498 |
467 } // namespace mus | 499 } // namespace mus |
468 } // namespace ash | 500 } // namespace ash |
OLD | NEW |