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

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

Issue 2010473003: Wires up shelf to panel and dock layoutmanagers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment 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 | « mash/wm/shelf_layout_manager_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 5 #include "mash/wm/window_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 if (session) 77 if (session)
78 session->AddScreenlockStateListener(binding_.CreateInterfacePtrAndBind()); 78 session->AddScreenlockStateListener(binding_.CreateInterfacePtrAndBind());
79 } 79 }
80 80
81 mus::Window* WindowManager::NewTopLevelWindow( 81 mus::Window* WindowManager::NewTopLevelWindow(
82 std::map<std::string, std::vector<uint8_t>>* properties) { 82 std::map<std::string, std::vector<uint8_t>>* properties) {
83 DCHECK(root_controller_); 83 DCHECK(root_controller_);
84 mus::Window* root = root_controller_->root(); 84 mus::Window* root = root_controller_->root();
85 DCHECK(root); 85 DCHECK(root);
86 86
87 // TODO(sky): panels need a different frame, http:://crbug.com/614362.
87 const bool provide_non_client_frame = 88 const bool provide_non_client_frame =
88 GetWindowType(*properties) == mus::mojom::WindowType::WINDOW; 89 GetWindowType(*properties) == mus::mojom::WindowType::WINDOW ||
90 GetWindowType(*properties) == mus::mojom::WindowType::PANEL;
89 if (provide_non_client_frame) 91 if (provide_non_client_frame)
90 (*properties)[mus::mojom::kWaitForUnderlay_Property].clear(); 92 (*properties)[mus::mojom::kWaitForUnderlay_Property].clear();
91 93
92 // TODO(sky): constrain and validate properties before passing to server. 94 // TODO(sky): constrain and validate properties before passing to server.
93 mus::Window* window = root->connection()->NewWindow(properties); 95 mus::Window* window = root->connection()->NewWindow(properties);
94 window->SetBounds(CalculateDefaultBounds(window)); 96 window->SetBounds(CalculateDefaultBounds(window));
95 97
96 mus::Window* container_window = nullptr; 98 mus::Window* container_window = nullptr;
97 if (window->HasSharedProperty(mojom::kWindowContainer_Property)) { 99 if (window->HasSharedProperty(mojom::kWindowContainer_Property)) {
98 container_window = 100 container_window =
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 199
198 void WindowManager::ScreenlockStateChanged(bool locked) { 200 void WindowManager::ScreenlockStateChanged(bool locked) {
199 // Hide USER_PRIVATE_CONTAINER windows when the screen is locked. 201 // Hide USER_PRIVATE_CONTAINER windows when the screen is locked.
200 mus::Window* window = root_controller_->GetWindowForContainer( 202 mus::Window* window = root_controller_->GetWindowForContainer(
201 mash::wm::mojom::Container::USER_PRIVATE); 203 mash::wm::mojom::Container::USER_PRIVATE);
202 window->SetVisible(!locked); 204 window->SetVisible(!locked);
203 } 205 }
204 206
205 } // namespace wm 207 } // namespace wm
206 } // namespace mash 208 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/shelf_layout_manager_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698