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" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 mojo::Shell* shell, | 173 mojo::Shell* shell, |
174 mus::Window* window, | 174 mus::Window* window, |
175 mus::mojom::SurfaceType surface_type) | 175 mus::mojom::SurfaceType surface_type) |
176 : window_(window), | 176 : window_(window), |
177 shell_(shell), | 177 shell_(shell), |
178 native_widget_delegate_(delegate), | 178 native_widget_delegate_(delegate), |
179 surface_type_(surface_type), | 179 surface_type_(surface_type), |
180 show_state_before_fullscreen_(ui::PLATFORM_WINDOW_STATE_UNKNOWN), | 180 show_state_before_fullscreen_(ui::PLATFORM_WINDOW_STATE_UNKNOWN), |
181 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET), | 181 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET), |
182 content_(new aura::Window(this)), | 182 content_(new aura::Window(this)), |
183 close_widget_factory_(this) {} | 183 close_widget_factory_(this) { |
| 184 // TODO(fsamuel): Figure out lifetime of |window_|. |
| 185 content_->SetNativeWindowProperty("mus", window_); |
| 186 } |
184 | 187 |
185 NativeWidgetMus::~NativeWidgetMus() { | 188 NativeWidgetMus::~NativeWidgetMus() { |
186 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) | 189 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) |
187 delete native_widget_delegate_; | 190 delete native_widget_delegate_; |
188 else | 191 else |
189 CloseNow(); | 192 CloseNow(); |
190 } | 193 } |
191 | 194 |
192 // static | 195 // static |
193 void NativeWidgetMus::SetWindowManagerClientAreaInsets( | 196 void NativeWidgetMus::SetWindowManagerClientAreaInsets( |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 } else { | 782 } else { |
780 native_widget_delegate_->OnScrollEvent(event); | 783 native_widget_delegate_->OnScrollEvent(event); |
781 } | 784 } |
782 } | 785 } |
783 | 786 |
784 void NativeWidgetMus::OnGestureEvent(ui::GestureEvent* event) { | 787 void NativeWidgetMus::OnGestureEvent(ui::GestureEvent* event) { |
785 native_widget_delegate_->OnGestureEvent(event); | 788 native_widget_delegate_->OnGestureEvent(event); |
786 } | 789 } |
787 | 790 |
788 } // namespace views | 791 } // namespace views |
OLD | NEW |