| OLD | NEW |
| 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 "ash/mus/window_manager.h" | 5 #include "ash/mus/window_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 shell_.reset(new WmShellMus(base::MakeUnique<ShellDelegateMus>(connector_), | 136 shell_.reset(new WmShellMus(base::MakeUnique<ShellDelegateMus>(connector_), |
| 137 this, pointer_watcher_event_router_.get())); | 137 this, pointer_watcher_event_router_.get())); |
| 138 shell_->Initialize(blocking_pool); | 138 shell_->Initialize(blocking_pool); |
| 139 lookup_.reset(new WmLookupMus); | 139 lookup_.reset(new WmLookupMus); |
| 140 | 140 |
| 141 // TODO: this should be called when logged in. See http://crbug.com/654606. | 141 // TODO: this should be called when logged in. See http://crbug.com/654606. |
| 142 shell_->CreateShelf(); | 142 shell_->CreateShelf(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void WindowManager::SetScreenLocked(bool is_locked) { | |
| 146 // TODO: screen locked state needs to be persisted for newly added displays. | |
| 147 for (auto& root_window_controller : root_window_controllers_) { | |
| 148 WmWindowMus* non_lock_screen_containers_container = | |
| 149 root_window_controller->GetWindowByShellWindowId( | |
| 150 kShellWindowId_NonLockScreenContainersContainer); | |
| 151 if (is_locked) | |
| 152 non_lock_screen_containers_container->aura_window()->Hide(); | |
| 153 else | |
| 154 non_lock_screen_containers_container->aura_window()->Show(); | |
| 155 } | |
| 156 } | |
| 157 | |
| 158 aura::Window* WindowManager::NewTopLevelWindow( | 145 aura::Window* WindowManager::NewTopLevelWindow( |
| 159 ui::mojom::WindowType window_type, | 146 ui::mojom::WindowType window_type, |
| 160 std::map<std::string, std::vector<uint8_t>>* properties) { | 147 std::map<std::string, std::vector<uint8_t>>* properties) { |
| 161 RootWindowController* root_window_controller = | 148 RootWindowController* root_window_controller = |
| 162 GetRootWindowControllerForNewTopLevelWindow(properties); | 149 GetRootWindowControllerForNewTopLevelWindow(properties); |
| 163 aura::Window* window = | 150 aura::Window* window = |
| 164 root_window_controller->NewTopLevelWindow(window_type, properties); | 151 root_window_controller->NewTopLevelWindow(window_type, properties); |
| 165 if (properties->count( | 152 if (properties->count( |
| 166 ui::mojom::WindowManager::kWindowIgnoredByShelf_Property)) { | 153 ui::mojom::WindowManager::kWindowIgnoredByShelf_Property)) { |
| 167 wm::WindowState* window_state = | 154 wm::WindowState* window_state = |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 | 500 |
| 514 void WindowManager::OnWindowInitialized(aura::Window* window) { | 501 void WindowManager::OnWindowInitialized(aura::Window* window) { |
| 515 // This ensures WmWindowAura won't be called before WmWindowMus. This is | 502 // This ensures WmWindowAura won't be called before WmWindowMus. This is |
| 516 // important as if WmWindowAura::Get() is called first, then WmWindowAura | 503 // important as if WmWindowAura::Get() is called first, then WmWindowAura |
| 517 // would be created, not WmWindowMus. | 504 // would be created, not WmWindowMus. |
| 518 WmWindowMus::Get(window); | 505 WmWindowMus::Get(window); |
| 519 } | 506 } |
| 520 | 507 |
| 521 } // namespace mus | 508 } // namespace mus |
| 522 } // namespace ash | 509 } // namespace ash |
| OLD | NEW |