| 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 "ui/views/mus/native_widget_mus.h" | 5 #include "ui/views/mus/native_widget_mus.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "components/mus/public/cpp/property_type_converters.h" | 8 #include "components/mus/public/cpp/property_type_converters.h" |
| 9 #include "components/mus/public/cpp/window.h" | 9 #include "components/mus/public/cpp/window.h" |
| 10 #include "components/mus/public/cpp/window_property.h" | 10 #include "components/mus/public/cpp/window_property.h" |
| 11 #include "mojo/converters/geometry/geometry_type_converters.h" | 11 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 12 #include "ui/aura/client/default_capture_client.h" | 12 #include "ui/aura/client/default_capture_client.h" |
| 13 #include "ui/aura/client/window_tree_client.h" | 13 #include "ui/aura/client/window_tree_client.h" |
| 14 #include "ui/aura/env.h" | 14 #include "ui/aura/env.h" |
| 15 #include "ui/aura/layout_manager.h" | 15 #include "ui/aura/layout_manager.h" |
| 16 #include "ui/aura/mus/mus_util.h" |
| 16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 17 #include "ui/base/hit_test.h" | 18 #include "ui/base/hit_test.h" |
| 18 #include "ui/compositor/clip_transform_recorder.h" | 19 #include "ui/compositor/clip_transform_recorder.h" |
| 19 #include "ui/compositor/paint_recorder.h" | 20 #include "ui/compositor/paint_recorder.h" |
| 20 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
| 21 #include "ui/native_theme/native_theme_aura.h" | 22 #include "ui/native_theme/native_theme_aura.h" |
| 22 #include "ui/views/mus/platform_window_mus.h" | 23 #include "ui/views/mus/platform_window_mus.h" |
| 23 #include "ui/views/mus/surface_context_factory.h" | 24 #include "ui/views/mus/surface_context_factory.h" |
| 24 #include "ui/views/mus/window_manager_client_area_insets.h" | 25 #include "ui/views/mus/window_manager_client_area_insets.h" |
| 25 #include "ui/views/mus/window_tree_host_mus.h" | 26 #include "ui/views/mus/window_tree_host_mus.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 mojo::Shell* shell, | 174 mojo::Shell* shell, |
| 174 mus::Window* window, | 175 mus::Window* window, |
| 175 mus::mojom::SurfaceType surface_type) | 176 mus::mojom::SurfaceType surface_type) |
| 176 : window_(window), | 177 : window_(window), |
| 177 shell_(shell), | 178 shell_(shell), |
| 178 native_widget_delegate_(delegate), | 179 native_widget_delegate_(delegate), |
| 179 surface_type_(surface_type), | 180 surface_type_(surface_type), |
| 180 show_state_before_fullscreen_(ui::PLATFORM_WINDOW_STATE_UNKNOWN), | 181 show_state_before_fullscreen_(ui::PLATFORM_WINDOW_STATE_UNKNOWN), |
| 181 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET), | 182 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET), |
| 182 content_(new aura::Window(this)), | 183 content_(new aura::Window(this)), |
| 183 close_widget_factory_(this) {} | 184 close_widget_factory_(this) { |
| 185 // TODO(fsamuel): Figure out lifetime of |window_|. |
| 186 aura::SetMusWindow(content_, window_); |
| 187 } |
| 184 | 188 |
| 185 NativeWidgetMus::~NativeWidgetMus() { | 189 NativeWidgetMus::~NativeWidgetMus() { |
| 186 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) | 190 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) |
| 187 delete native_widget_delegate_; | 191 delete native_widget_delegate_; |
| 188 else | 192 else |
| 189 CloseNow(); | 193 CloseNow(); |
| 190 } | 194 } |
| 191 | 195 |
| 192 // static | 196 // static |
| 193 void NativeWidgetMus::SetWindowManagerClientAreaInsets( | 197 void NativeWidgetMus::SetWindowManagerClientAreaInsets( |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 } else { | 783 } else { |
| 780 native_widget_delegate_->OnScrollEvent(event); | 784 native_widget_delegate_->OnScrollEvent(event); |
| 781 } | 785 } |
| 782 } | 786 } |
| 783 | 787 |
| 784 void NativeWidgetMus::OnGestureEvent(ui::GestureEvent* event) { | 788 void NativeWidgetMus::OnGestureEvent(ui::GestureEvent* event) { |
| 785 native_widget_delegate_->OnGestureEvent(event); | 789 native_widget_delegate_->OnGestureEvent(event); |
| 786 } | 790 } |
| 787 | 791 |
| 788 } // namespace views | 792 } // namespace views |
| OLD | NEW |