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

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

Issue 1979323002: mus: Show USER_PRIVATE window container during views tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@widgetinteractive
Patch Set: rebase, fix linux Created 4 years, 7 months 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
« no previous file with comments | « components/mus/ws/window_tree.cc ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/wm/root_window_controller.h" 5 #include "mash/wm/root_window_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <sstream> 10 #include <sstream>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h"
13 #include "components/mus/common/event_matcher_util.h" 14 #include "components/mus/common/event_matcher_util.h"
15 #include "components/mus/common/switches.h"
14 #include "components/mus/common/util.h" 16 #include "components/mus/common/util.h"
15 #include "components/mus/public/cpp/property_type_converters.h" 17 #include "components/mus/public/cpp/property_type_converters.h"
16 #include "components/mus/public/cpp/window.h" 18 #include "components/mus/public/cpp/window.h"
17 #include "components/mus/public/cpp/window_tree_connection.h" 19 #include "components/mus/public/cpp/window_tree_connection.h"
18 #include "components/mus/public/cpp/window_tree_host_factory.h" 20 #include "components/mus/public/cpp/window_tree_host_factory.h"
19 #include "components/mus/public/interfaces/window_manager.mojom.h" 21 #include "components/mus/public/interfaces/window_manager.mojom.h"
20 #include "mash/session/public/interfaces/session.mojom.h" 22 #include "mash/session/public/interfaces/session.mojom.h"
21 #include "mash/wm/background_layout.h" 23 #include "mash/wm/background_layout.h"
22 #include "mash/wm/container_ids.h" 24 #include "mash/wm/container_ids.h"
23 #include "mash/wm/fill_layout.h" 25 #include "mash/wm/fill_layout.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 std::ostringstream container_name; 185 std::ostringstream container_name;
184 container_name << container; 186 container_name << container;
185 properties[mus::mojom::WindowManager::kName_Property] = 187 properties[mus::mojom::WindowManager::kName_Property] =
186 mojo::ConvertTo<std::vector<uint8_t>>(container_name.str()); 188 mojo::ConvertTo<std::vector<uint8_t>>(container_name.str());
187 189
188 mus::Window* window = root_->connection()->NewWindow(&properties); 190 mus::Window* window = root_->connection()->NewWindow(&properties);
189 window->set_local_id(ContainerToLocalId(container)); 191 window->set_local_id(ContainerToLocalId(container));
190 layout_managers_[window].reset(new FillLayout(window)); 192 layout_managers_[window].reset(new FillLayout(window));
191 193
192 // User private windows are hidden by default until the window manager learns 194 // User private windows are hidden by default until the window manager learns
193 // the lock state, so their contents are never accidentally revealed. 195 // the lock state, so their contents are never accidentally revealed. Tests,
194 window->SetVisible(container != mojom::Container::USER_PRIVATE); 196 // however, usually assume the screen is unlocked.
197 const bool is_test = base::CommandLine::ForCurrentProcess()->HasSwitch(
198 mus::switches::kUseTestConfig);
199 window->SetVisible(container != mojom::Container::USER_PRIVATE || is_test);
200
195 mus::Window* parent = 201 mus::Window* parent =
196 root_->GetChildByLocalId(ContainerToLocalId(parent_container)); 202 root_->GetChildByLocalId(ContainerToLocalId(parent_container));
197 parent->AddChild(window); 203 parent->AddChild(window);
198 } 204 }
199 205
200 void RootWindowController::CreateContainers() { 206 void RootWindowController::CreateContainers() {
201 CreateContainer(mojom::Container::ALL_USER_BACKGROUND, 207 CreateContainer(mojom::Container::ALL_USER_BACKGROUND,
202 mojom::Container::ROOT); 208 mojom::Container::ROOT);
203 CreateContainer(mojom::Container::USER, mojom::Container::ROOT); 209 CreateContainer(mojom::Container::USER, mojom::Container::ROOT);
204 CreateContainer(mojom::Container::USER_BACKGROUND, mojom::Container::USER); 210 CreateContainer(mojom::Container::USER_BACKGROUND, mojom::Container::USER);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 layout_managers_[status].reset(new StatusLayoutManager(status)); 254 layout_managers_[status].reset(new StatusLayoutManager(status));
249 255
250 mus::Window* user_private_windows = 256 mus::Window* user_private_windows =
251 GetWindowForContainer(mojom::Container::USER_PRIVATE_WINDOWS); 257 GetWindowForContainer(mojom::Container::USER_PRIVATE_WINDOWS);
252 layout_managers_[user_private_windows].reset( 258 layout_managers_[user_private_windows].reset(
253 new WindowLayout(user_private_windows)); 259 new WindowLayout(user_private_windows));
254 } 260 }
255 261
256 } // namespace wm 262 } // namespace wm
257 } // namespace mash 263 } // namespace mash
OLDNEW
« no previous file with comments | « components/mus/ws/window_tree.cc ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698