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

Side by Side Diff: ash/mus/root_window_controller.cc

Issue 2302673002: mash: Avoid shelf crashes on display removal. (Closed)
Patch Set: minor cleanup. Created 4 years, 3 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
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 "ash/mus/root_window_controller.h" 5 #include "ash/mus/root_window_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 GetWindowByShellWindowId(MashContainerToAshShellWindowId(container)); 128 GetWindowByShellWindowId(MashContainerToAshShellWindowId(container));
129 DCHECK(wm_window); 129 DCHECK(wm_window);
130 return wm_window->mus_window(); 130 return wm_window->mus_window();
131 } 131 }
132 132
133 WmWindowMus* RootWindowController::GetWindowByShellWindowId(int id) { 133 WmWindowMus* RootWindowController::GetWindowByShellWindowId(int id) {
134 return WmWindowMus::AsWmWindowMus( 134 return WmWindowMus::AsWmWindowMus(
135 WmWindowMus::Get(root_)->GetChildByShellWindowId(id)); 135 WmWindowMus::Get(root_)->GetChildByShellWindowId(id));
136 } 136 }
137 137
138 void RootWindowController::Shutdown() {
139 wm_shelf_->ShutdownShelfWidget();
sky 2016/09/01 23:51:17 Can this be moved to WmRootWindowController? I thi
140 }
141
138 gfx::Rect RootWindowController::CalculateDefaultBounds( 142 gfx::Rect RootWindowController::CalculateDefaultBounds(
139 ui::Window* window) const { 143 ui::Window* window) const {
140 if (window->HasSharedProperty( 144 if (window->HasSharedProperty(
141 ui::mojom::WindowManager::kInitialBounds_Property)) { 145 ui::mojom::WindowManager::kInitialBounds_Property)) {
142 return window->GetSharedProperty<gfx::Rect>( 146 return window->GetSharedProperty<gfx::Rect>(
143 ui::mojom::WindowManager::kInitialBounds_Property); 147 ui::mojom::WindowManager::kInitialBounds_Property);
144 } 148 }
145 149
146 if (GetWindowShowState(window) == ui::mojom::ShowState::FULLSCREEN) { 150 if (GetWindowShowState(window) == ui::mojom::ShowState::FULLSCREEN) {
147 return gfx::Rect(0, 0, root_->bounds().width(), root_->bounds().height()); 151 return gfx::Rect(0, 0, root_->bounds().width(), root_->bounds().height());
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 WmWindowMus* panel_container = 195 WmWindowMus* panel_container =
192 GetWindowByShellWindowId(kShellWindowId_PanelContainer); 196 GetWindowByShellWindowId(kShellWindowId_PanelContainer);
193 std::unique_ptr<PanelLayoutManager> panel_layout_manager = 197 std::unique_ptr<PanelLayoutManager> panel_layout_manager =
194 base::MakeUnique<PanelLayoutManager>(panel_container); 198 base::MakeUnique<PanelLayoutManager>(panel_container);
195 panel_layout_manager->SetShelf(wm_shelf_.get()); 199 panel_layout_manager->SetShelf(wm_shelf_.get());
196 panel_container->SetLayoutManager(std::move(panel_layout_manager)); 200 panel_container->SetLayoutManager(std::move(panel_layout_manager));
197 } 201 }
198 202
199 } // namespace mus 203 } // namespace mus
200 } // namespace ash 204 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698