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/macros.h" | 7 #include "base/macros.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "components/mus/public/cpp/property_type_converters.h" | 9 #include "components/mus/public/cpp/property_type_converters.h" |
10 #include "components/mus/public/cpp/window.h" | 10 #include "components/mus/public/cpp/window.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // For Chrome, we need the GpuProcessTransportFactory so that renderer and | 300 // For Chrome, we need the GpuProcessTransportFactory so that renderer and |
301 // browser pixels are composited into a single backing | 301 // browser pixels are composited into a single backing |
302 // SoftwareOutputDeviceMus. | 302 // SoftwareOutputDeviceMus. |
303 if (!default_context_factory) { | 303 if (!default_context_factory) { |
304 if (!context_factory_) { | 304 if (!context_factory_) { |
305 context_factory_.reset(new SurfaceContextFactory(shell_, window_, | 305 context_factory_.reset(new SurfaceContextFactory(shell_, window_, |
306 surface_type_)); | 306 surface_type_)); |
307 } | 307 } |
308 aura::Env::GetInstance()->set_context_factory(context_factory_.get()); | 308 aura::Env::GetInstance()->set_context_factory(context_factory_.get()); |
309 } | 309 } |
310 window_tree_host_.reset( | 310 window_tree_host_.reset(new WindowTreeHostMus(shell_, this, window_)); |
311 new WindowTreeHostMus(shell_, this, window_, surface_type_)); | |
312 window_tree_host_->AddObserver(this); | 311 window_tree_host_->AddObserver(this); |
313 window_tree_host_->InitHost(); | 312 window_tree_host_->InitHost(); |
314 aura::Env::GetInstance()->set_context_factory(default_context_factory); | 313 aura::Env::GetInstance()->set_context_factory(default_context_factory); |
315 window_tree_host_->window()->SetProperty(kMusWindow, window_); | 314 window_tree_host_->window()->SetProperty(kMusWindow, window_); |
316 | 315 |
317 focus_client_.reset(new wm::FocusController(new FocusRulesImpl)); | 316 focus_client_.reset(new wm::FocusController(new FocusRulesImpl)); |
318 | 317 |
319 aura::client::SetFocusClient(window_tree_host_->window(), | 318 aura::client::SetFocusClient(window_tree_host_->window(), |
320 focus_client_.get()); | 319 focus_client_.get()); |
321 aura::client::SetActivationClient(window_tree_host_->window(), | 320 aura::client::SetActivationClient(window_tree_host_->window(), |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 | 848 |
850 void NativeWidgetMus::OnGestureEvent(ui::GestureEvent* event) { | 849 void NativeWidgetMus::OnGestureEvent(ui::GestureEvent* event) { |
851 native_widget_delegate_->OnGestureEvent(event); | 850 native_widget_delegate_->OnGestureEvent(event); |
852 } | 851 } |
853 | 852 |
854 void NativeWidgetMus::OnHostCloseRequested(const aura::WindowTreeHost* host) { | 853 void NativeWidgetMus::OnHostCloseRequested(const aura::WindowTreeHost* host) { |
855 GetWidget()->Close(); | 854 GetWidget()->Close(); |
856 } | 855 } |
857 | 856 |
858 } // namespace views | 857 } // namespace views |
OLD | NEW |