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

Side by Side Diff: ash/display/display_controller.cc

Issue 803693002: Add/update checks to diagnose the NPE issue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/display/display_controller.h" 5 #include "ash/display/display_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 // When the primary root window's display is removed, move the primary 623 // When the primary root window's display is removed, move the primary
624 // root to the other display. 624 // root to the other display.
625 if (primary_display_id == display.id()) { 625 if (primary_display_id == display.id()) {
626 // Temporarily store the primary root window in 626 // Temporarily store the primary root window in
627 // |primary_root_window_for_replace_| when replacing the display. 627 // |primary_root_window_for_replace_| when replacing the display.
628 if (window_tree_hosts_.size() == 0) { 628 if (window_tree_hosts_.size() == 0) {
629 primary_display_id = gfx::Display::kInvalidDisplayID; 629 primary_display_id = gfx::Display::kInvalidDisplayID;
630 primary_tree_host_for_replace_ = host_to_delete; 630 primary_tree_host_for_replace_ = host_to_delete;
631 return; 631 return;
632 } 632 }
633 DCHECK_EQ(1U, window_tree_hosts_.size());
634 primary_display_id = ScreenUtil::GetSecondaryDisplay().id(); 633 primary_display_id = ScreenUtil::GetSecondaryDisplay().id();
634 CHECK_NE(gfx::Display::kInvalidDisplayID, primary_display_id);
635
636 CHECK_EQ(1U, window_tree_hosts_.count(primary_display_id));
637
635 AshWindowTreeHost* primary_host = host_to_delete; 638 AshWindowTreeHost* primary_host = host_to_delete;
636
637 // Delete the other host instead. 639 // Delete the other host instead.
638 host_to_delete = window_tree_hosts_[primary_display_id]; 640 host_to_delete = window_tree_hosts_[primary_display_id];
639 GetRootWindowSettings(GetWindow(host_to_delete))->display_id = display.id(); 641 GetRootWindowSettings(GetWindow(host_to_delete))->display_id = display.id();
640 642
641 // Setup primary root. 643 // Setup primary root.
642 window_tree_hosts_[primary_display_id] = primary_host; 644 window_tree_hosts_[primary_display_id] = primary_host;
643 GetRootWindowSettings(GetWindow(primary_host))->display_id = 645 GetRootWindowSettings(GetWindow(primary_host))->display_id =
644 primary_display_id; 646 primary_display_id;
645 647
646 OnDisplayMetricsChanged( 648 OnDisplayMetricsChanged(
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 std::string name = 808 std::string name =
807 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; 809 root_windows[i] == primary ? "aura_root_0" : "aura_root_x";
808 gfx::AcceleratedWidget xwindow = 810 gfx::AcceleratedWidget xwindow =
809 root_windows[i]->GetHost()->GetAcceleratedWidget(); 811 root_windows[i]->GetHost()->GetAcceleratedWidget();
810 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); 812 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str());
811 } 813 }
812 #endif 814 #endif
813 } 815 }
814 816
815 } // namespace ash 817 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698