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

Unified Diff: ash/mus/root_window_controller.cc

Issue 2114043002: Two fixes for mash browser_tests on chromes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/chrome_browser_main_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/root_window_controller.cc
diff --git a/ash/mus/root_window_controller.cc b/ash/mus/root_window_controller.cc
index 46b52128e12c0cd7eb7c42ad54da13fd1bca0b25..3a3ea6a4edcc58e79f55814265f8e3f7d03aa17a 100644
--- a/ash/mus/root_window_controller.cc
+++ b/ash/mus/root_window_controller.cc
@@ -197,8 +197,17 @@ gfx::Rect RootWindowController::CalculateDefaultBounds(
}
void RootWindowController::OnShelfWindowAvailable() {
- DockedWindowLayoutManager::Get(WmWindowMus::Get(root_))
- ->SetShelf(wm_shelf_.get());
+ DockedWindowLayoutManager* docked_window_layout_manager =
+ DockedWindowLayoutManager::Get(WmWindowMus::Get(root_));
+
+ // Following code expects the shelf to be called only once.
+ // TODO(sky): this check is only necessary while we have shelf hosted in
+ // sysui (as sysui can restart). Once that is fixed there should be a DCHECK
+ // that the shelf hasn't been set.
+ if (docked_window_layout_manager->shelf())
+ return;
+
+ docked_window_layout_manager->SetShelf(wm_shelf_.get());
PanelLayoutManager::Get(WmWindowMus::Get(root_))->SetShelf(wm_shelf_.get());
« no previous file with comments | « no previous file | chrome/browser/chromeos/chrome_browser_main_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698