| 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_ = base::MakeUnique<views::AuraInit>( | 367 aura_init_ = base::MakeUnique<views::AuraInit>(); |
| 368 context()->connector(), context()->identity(), "views_mus_resources.pak", | 368 if (!aura_init_->Init(context()->connector(), context()->identity(), |
| 369 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER); | 369 "views_mus_resources.pak", std::string(), nullptr, |
| 370 views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER)) { |
| 371 context()->QuitNow(); |
| 372 return; |
| 373 } |
| 370 window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>( | 374 window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>( |
| 371 context()->connector(), this, this); | 375 context()->connector(), this, this); |
| 372 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client_.get()); | 376 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client_.get()); |
| 373 window_tree_client_->ConnectAsWindowManager(); | 377 window_tree_client_->ConnectAsWindowManager(); |
| 374 } | 378 } |
| 375 | 379 |
| 376 //////////////////////////////////////////////////////////////////////////////// | 380 //////////////////////////////////////////////////////////////////////////////// |
| 377 // SimpleWM, aura::WindowTreeClientDelegate implementation: | 381 // SimpleWM, aura::WindowTreeClientDelegate implementation: |
| 378 | 382 |
| 379 void SimpleWM::OnEmbed( | 383 void SimpleWM::OnEmbed( |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 } | 592 } |
| 589 | 593 |
| 590 void SimpleWM::OnWindowListViewItemActivated(aura::Window* window) { | 594 void SimpleWM::OnWindowListViewItemActivated(aura::Window* window) { |
| 591 window->Show(); | 595 window->Show(); |
| 592 wm::ActivationClient* activation_client = | 596 wm::ActivationClient* activation_client = |
| 593 wm::GetActivationClient(window->GetRootWindow()); | 597 wm::GetActivationClient(window->GetRootWindow()); |
| 594 activation_client->ActivateWindow(window); | 598 activation_client->ActivateWindow(window); |
| 595 } | 599 } |
| 596 | 600 |
| 597 } // namespace simple_wm | 601 } // namespace simple_wm |
| OLD | NEW |