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

Side by Side Diff: mash/wm/window_manager_application.cc

Issue 1459463004: mus: Allow the WM to specify the windows that can have active children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month 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 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 "mash/wm/window_manager_application.h" 5 #include "mash/wm/window_manager_application.h"
6 6
7 #include "components/mus/common/util.h" 7 #include "components/mus/common/util.h"
8 #include "components/mus/public/cpp/window.h" 8 #include "components/mus/public/cpp/window.h"
9 #include "components/mus/public/cpp/window_tree_connection.h" 9 #include "components/mus/public/cpp/window_tree_connection.h"
10 #include "components/mus/public/cpp/window_tree_host_factory.h" 10 #include "components/mus/public/cpp/window_tree_host_factory.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 void WindowManagerApplication::OnEmbed(mus::Window* root) { 50 void WindowManagerApplication::OnEmbed(mus::Window* root) {
51 root_ = root; 51 root_ = root;
52 root_->AddObserver(this); 52 root_->AddObserver(this);
53 CreateContainers(); 53 CreateContainers();
54 background_layout_.reset(new BackgroundLayout( 54 background_layout_.reset(new BackgroundLayout(
55 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_BACKGROUND))); 55 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_BACKGROUND)));
56 shelf_layout_.reset(new ShelfLayout( 56 shelf_layout_.reset(new ShelfLayout(
57 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_SHELF))); 57 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_SHELF)));
58
59 mus::Window* window =
60 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_WINDOWS);
58 window_layout_.reset(new WindowLayout( 61 window_layout_.reset(new WindowLayout(
59 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_WINDOWS))); 62 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_WINDOWS)));
63 host_->SetActivationParent(window->id(), true);
60 64
61 window_manager_.reset(new WindowManagerImpl(this)); 65 window_manager_.reset(new WindowManagerImpl(this));
62 66
63 ui_init_.reset(new ui::mojo::UIInit(views::GetDisplaysFromWindow(root))); 67 ui_init_.reset(new ui::mojo::UIInit(views::GetDisplaysFromWindow(root)));
64 aura_init_.reset(new views::AuraInit(app_, "views_mus_resources.pak")); 68 aura_init_.reset(new views::AuraInit(app_, "views_mus_resources.pak"));
65 69
66 for (auto request : requests_) 70 for (auto request : requests_)
67 window_manager_binding_.AddBinding(window_manager_.get(), request->Pass()); 71 window_manager_binding_.AddBinding(window_manager_.get(), request->Pass());
68 requests_.clear(); 72 requests_.clear();
69 } 73 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 container < static_cast<uint16_t>(mash::wm::mojom::CONTAINER_COUNT); 119 container < static_cast<uint16_t>(mash::wm::mojom::CONTAINER_COUNT);
116 ++container) { 120 ++container) {
117 mus::Window* window = root_->connection()->NewWindow(); 121 mus::Window* window = root_->connection()->NewWindow();
118 DCHECK_EQ(mus::LoWord(window->id()), container) 122 DCHECK_EQ(mus::LoWord(window->id()), container)
119 << "Containers must be created before other windows!"; 123 << "Containers must be created before other windows!";
120 window->SetBounds(root_->bounds()); 124 window->SetBounds(root_->bounds());
121 window->SetVisible(true); 125 window->SetVisible(true);
122 root_->AddChild(window); 126 root_->AddChild(window);
123 } 127 }
124 } 128 }
OLDNEW
« components/mus/ws/window_tree_host_impl.cc ('K') | « mandoline/ui/desktop_ui/browser_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698