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

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

Issue 1870733004: Clear the software mirroring display list when adding it to the updated list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | ash/display/display_manager_unittest.cc » ('j') | 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_manager.h" 5 #include "ash/display/display_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 return &(*iter); 1214 return &(*iter);
1215 // TODO(oshima): This happens when a windows in unified desktop have 1215 // TODO(oshima): This happens when a windows in unified desktop have
1216 // been moved to normal window. Fix this. 1216 // been moved to normal window. Fix this.
1217 if (id != kUnifiedDisplayId) 1217 if (id != kUnifiedDisplayId)
1218 DLOG(WARNING) << "Could not find display:" << id; 1218 DLOG(WARNING) << "Could not find display:" << id;
1219 return nullptr; 1219 return nullptr;
1220 } 1220 }
1221 1221
1222 void DisplayManager::AddMirrorDisplayInfoIfAny( 1222 void DisplayManager::AddMirrorDisplayInfoIfAny(
1223 std::vector<DisplayInfo>* display_info_list) { 1223 std::vector<DisplayInfo>* display_info_list) {
1224 if (software_mirroring_enabled() && IsInMirrorMode()) 1224 if (software_mirroring_enabled() && IsInMirrorMode()) {
1225 display_info_list->push_back(GetDisplayInfo(mirroring_display_id_)); 1225 display_info_list->push_back(GetDisplayInfo(mirroring_display_id_));
1226 software_mirroring_display_list_.clear();
1227 }
1226 } 1228 }
1227 1229
1228 void DisplayManager::InsertAndUpdateDisplayInfo(const DisplayInfo& new_info) { 1230 void DisplayManager::InsertAndUpdateDisplayInfo(const DisplayInfo& new_info) {
1229 std::map<int64_t, DisplayInfo>::iterator info = 1231 std::map<int64_t, DisplayInfo>::iterator info =
1230 display_info_.find(new_info.id()); 1232 display_info_.find(new_info.id());
1231 if (info != display_info_.end()) { 1233 if (info != display_info_.end()) {
1232 info->second.Copy(new_info); 1234 info->second.Copy(new_info);
1233 } else { 1235 } else {
1234 display_info_[new_info.id()] = new_info; 1236 display_info_[new_info.id()] = new_info;
1235 display_info_[new_info.id()].set_native(false); 1237 display_info_[new_info.id()].set_native(false);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 1397
1396 return old_bounds != target_display->bounds(); 1398 return old_bounds != target_display->bounds();
1397 } 1399 }
1398 1400
1399 void DisplayManager::RunPendingTasksForTest() { 1401 void DisplayManager::RunPendingTasksForTest() {
1400 if (!software_mirroring_display_list_.empty()) 1402 if (!software_mirroring_display_list_.empty())
1401 base::RunLoop().RunUntilIdle(); 1403 base::RunLoop().RunUntilIdle();
1402 } 1404 }
1403 1405
1404 } // namespace ash 1406 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698