Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1745)

Side by Side Diff: mash/simple_wm/simple_wm.cc

Issue 2567293004: Makes WindowTreeHost::InitHost() not Show the window (Closed)
Patch Set: WTF::Show shows window Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/layout_manager.h" 10 #include "ui/aura/layout_manager.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 display::DisplayList::Type::PRIMARY); 392 display::DisplayList::Type::PRIMARY);
393 } 393 }
394 394
395 void SimpleWM::OnWmNewDisplay( 395 void SimpleWM::OnWmNewDisplay(
396 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, 396 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
397 const display::Display& display) { 397 const display::Display& display) {
398 // Only handles a single root. 398 // Only handles a single root.
399 DCHECK(!window_root_); 399 DCHECK(!window_root_);
400 window_tree_host_ = std::move(window_tree_host); 400 window_tree_host_ = std::move(window_tree_host);
401 window_tree_host_->InitHost(); 401 window_tree_host_->InitHost();
402 window_tree_host_->window()->Show();
402 display_root_ = window_tree_host_->window(); 403 display_root_ = window_tree_host_->window();
403 window_root_ = new aura::Window(nullptr); 404 window_root_ = new aura::Window(nullptr);
404 window_root_->Init(ui::LAYER_NOT_DRAWN); 405 window_root_->Init(ui::LAYER_NOT_DRAWN);
405 display_root_->AddChild(window_root_); 406 display_root_->AddChild(window_root_);
406 window_root_->Show(); 407 window_root_->Show();
407 408
408 window_list_model_ = base::MakeUnique<WindowListModel>(window_root_); 409 window_list_model_ = base::MakeUnique<WindowListModel>(window_root_);
409 410
410 views::Widget* window_list_widget = new views::Widget; 411 views::Widget* window_list_widget = new views::Widget;
411 views::NativeWidgetAura* window_list_widget_native_widget = 412 views::NativeWidgetAura* window_list_widget_native_widget =
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 return it != client_window_to_frame_view_.end() ? it->second : nullptr; 468 return it != client_window_to_frame_view_.end() ? it->second : nullptr;
468 } 469 }
469 470
470 void SimpleWM::OnWindowListViewItemActivated(aura::Window* window) { 471 void SimpleWM::OnWindowListViewItemActivated(aura::Window* window) {
471 aura::client::ActivationClient* activation_client = 472 aura::client::ActivationClient* activation_client =
472 aura::client::GetActivationClient(window->GetRootWindow()); 473 aura::client::GetActivationClient(window->GetRootWindow());
473 activation_client->ActivateWindow(window); 474 activation_client->ActivateWindow(window);
474 } 475 }
475 476
476 } // namespace simple_wm 477 } // namespace simple_wm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698