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

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

Issue 578553002: Use DSF instead of UI scale if the native DSF is 1.25 and UI Scale is 0.8x (dsf=1.25 equivalent) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « ash/display/display_info.cc ('k') | 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 CommandLine* command_line = CommandLine::ForCurrentProcess(); 245 CommandLine* command_line = CommandLine::ForCurrentProcess();
246 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) 246 if (!command_line->HasSwitch(switches::kAshHostWindowBounds))
247 return false; 247 return false;
248 const string size_str = 248 const string size_str =
249 command_line->GetSwitchValueASCII(switches::kAshHostWindowBounds); 249 command_line->GetSwitchValueASCII(switches::kAshHostWindowBounds);
250 vector<string> parts; 250 vector<string> parts;
251 base::SplitString(size_str, ',', &parts); 251 base::SplitString(size_str, ',', &parts);
252 for (vector<string>::const_iterator iter = parts.begin(); 252 for (vector<string>::const_iterator iter = parts.begin();
253 iter != parts.end(); ++iter) { 253 iter != parts.end(); ++iter) {
254 info_list.push_back(DisplayInfo::CreateFromSpec(*iter)); 254 info_list.push_back(DisplayInfo::CreateFromSpec(*iter));
255 info_list.back().set_native(true);
oshima 2014/09/16 08:07:02 these are to get "restore display settings" workin
255 } 256 }
256 MaybeInitInternalDisplay(info_list[0].id()); 257 MaybeInitInternalDisplay(info_list[0].id());
257 if (info_list.size() > 1 && 258 if (info_list.size() > 1 &&
258 command_line->HasSwitch(switches::kAshEnableSoftwareMirroring)) { 259 command_line->HasSwitch(switches::kAshEnableSoftwareMirroring)) {
259 SetSecondDisplayMode(MIRRORING); 260 SetSecondDisplayMode(MIRRORING);
260 } 261 }
261 OnNativeDisplaysChanged(info_list); 262 OnNativeDisplaysChanged(info_list);
262 return true; 263 return true;
263 } 264 }
264 265
265 void DisplayManager::InitDefaultDisplay() { 266 void DisplayManager::InitDefaultDisplay() {
266 DisplayInfoList info_list; 267 DisplayInfoList info_list;
267 info_list.push_back(DisplayInfo::CreateFromSpec(std::string())); 268 info_list.push_back(DisplayInfo::CreateFromSpec(std::string()));
269 info_list.back().set_native(true);
268 MaybeInitInternalDisplay(info_list[0].id()); 270 MaybeInitInternalDisplay(info_list[0].id());
269 OnNativeDisplaysChanged(info_list); 271 OnNativeDisplaysChanged(info_list);
270 } 272 }
271 273
272 void DisplayManager::InitFontParams() { 274 void DisplayManager::InitFontParams() {
273 #if defined(OS_CHROMEOS) 275 #if defined(OS_CHROMEOS)
274 if (!HasInternalDisplay()) 276 if (!HasInternalDisplay())
275 return; 277 return;
276 const DisplayInfo& display_info = 278 const DisplayInfo& display_info =
277 GetDisplayInfo(gfx::Display::InternalDisplayId()); 279 GetDisplayInfo(gfx::Display::InternalDisplayId());
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 new_secondary_origin.Offset(-secondary_bounds.width(), offset); 1261 new_secondary_origin.Offset(-secondary_bounds.width(), offset);
1260 break; 1262 break;
1261 } 1263 }
1262 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); 1264 gfx::Insets insets = secondary_display->GetWorkAreaInsets();
1263 secondary_display->set_bounds( 1265 secondary_display->set_bounds(
1264 gfx::Rect(new_secondary_origin, secondary_bounds.size())); 1266 gfx::Rect(new_secondary_origin, secondary_bounds.size()));
1265 secondary_display->UpdateWorkAreaFromInsets(insets); 1267 secondary_display->UpdateWorkAreaFromInsets(insets);
1266 } 1268 }
1267 1269
1268 } // namespace ash 1270 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_info.cc ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698