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

Unified Diff: ash/display/window_tree_host_manager.cc

Issue 2391253004: Use mojo Shelf interfaces for both mash and classic ash. (Closed)
Patch Set: Address comments. Created 4 years, 2 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 | « ash/common/wm_shell.cc ('k') | ash/mus/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/window_tree_host_manager.cc
diff --git a/ash/display/window_tree_host_manager.cc b/ash/display/window_tree_host_manager.cc
index dc0f63d1e90b9bedfc89867396880f71d11f74d3..b7e99ee461fb75f5b2c4367bbad10e478b3e3b7f 100644
--- a/ash/display/window_tree_host_manager.cc
+++ b/ash/display/window_tree_host_manager.cc
@@ -332,15 +332,13 @@ aura::Window* WindowTreeHostManager::GetPrimaryRootWindow() {
aura::Window* WindowTreeHostManager::GetRootWindowForDisplayId(int64_t id) {
AshWindowTreeHost* host = GetAshWindowTreeHostForDisplayId(id);
- CHECK(host);
- return GetWindow(host);
+ return host ? GetWindow(host) : nullptr;
}
AshWindowTreeHost* WindowTreeHostManager::GetAshWindowTreeHostForDisplayId(
int64_t display_id) {
- CHECK_EQ(1u, window_tree_hosts_.count(display_id)) << "display id = "
- << display_id;
- return window_tree_hosts_[display_id];
+ const auto host = window_tree_hosts_.find(display_id);
+ return host == window_tree_hosts_.end() ? nullptr : host->second;
}
void WindowTreeHostManager::CloseChildWindows() {
« no previous file with comments | « ash/common/wm_shell.cc ('k') | ash/mus/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698