OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mash/simple_wm/simple_wm.h" | 5 #include "mash/simple_wm/simple_wm.h" |
6 | 6 |
7 #include "base/observer_list.h" | 7 #include "base/observer_list.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "mash/simple_wm/move_event_handler.h" | 9 #include "mash/simple_wm/move_event_handler.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 } | 357 } |
358 | 358 |
359 //////////////////////////////////////////////////////////////////////////////// | 359 //////////////////////////////////////////////////////////////////////////////// |
360 // SimpleWM, service_manager::Service implementation: | 360 // SimpleWM, service_manager::Service implementation: |
361 | 361 |
362 void SimpleWM::OnStart() { | 362 void SimpleWM::OnStart() { |
363 CHECK(!started_); | 363 CHECK(!started_); |
364 started_ = true; | 364 started_ = true; |
365 screen_ = base::MakeUnique<display::ScreenBase>(); | 365 screen_ = base::MakeUnique<display::ScreenBase>(); |
366 display::Screen::SetScreenInstance(screen_.get()); | 366 display::Screen::SetScreenInstance(screen_.get()); |
367 aura_init_ = views::AuraInit::Create( | 367 aura_init_ = base::MakeUnique<views::AuraInit>( |
368 context()->connector(), context()->identity(), "views_mus_resources.pak", | 368 context()->connector(), context()->identity(), "views_mus_resources.pak", |
369 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER); | 369 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER); |
370 if (!aura_init_) { | |
371 context()->QuitNow(); | |
372 return; | |
373 } | |
374 window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>( | 370 window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>( |
375 context()->connector(), this, this); | 371 context()->connector(), this, this); |
376 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client_.get()); | 372 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client_.get()); |
377 window_tree_client_->ConnectAsWindowManager(); | 373 window_tree_client_->ConnectAsWindowManager(); |
378 } | 374 } |
379 | 375 |
380 //////////////////////////////////////////////////////////////////////////////// | 376 //////////////////////////////////////////////////////////////////////////////// |
381 // SimpleWM, aura::WindowTreeClientDelegate implementation: | 377 // SimpleWM, aura::WindowTreeClientDelegate implementation: |
382 | 378 |
383 void SimpleWM::OnEmbed( | 379 void SimpleWM::OnEmbed( |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 } | 588 } |
593 | 589 |
594 void SimpleWM::OnWindowListViewItemActivated(aura::Window* window) { | 590 void SimpleWM::OnWindowListViewItemActivated(aura::Window* window) { |
595 window->Show(); | 591 window->Show(); |
596 wm::ActivationClient* activation_client = | 592 wm::ActivationClient* activation_client = |
597 wm::GetActivationClient(window->GetRootWindow()); | 593 wm::GetActivationClient(window->GetRootWindow()); |
598 activation_client->ActivateWindow(window); | 594 activation_client->ActivateWindow(window); |
599 } | 595 } |
600 | 596 |
601 } // namespace simple_wm | 597 } // namespace simple_wm |
OLD | NEW |