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

Side by Side Diff: ui/aura/monitor_manager.cc

Issue 10546158: Remove --default-device-scale-factor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/monitor_manager.h ('k') | ui/base/resource/resource_bundle_aurax11.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 "ui/aura/monitor_manager.h" 5 #include "ui/aura/monitor_manager.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/aura/display_observer.h" 10 #include "ui/aura/display_observer.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // static 26 // static
27 bool MonitorManager::use_fullscreen_host_window_ = false; 27 bool MonitorManager::use_fullscreen_host_window_ = false;
28 28
29 // static 29 // static
30 gfx::Display MonitorManager::CreateMonitorFromSpec(const std::string& spec) { 30 gfx::Display MonitorManager::CreateMonitorFromSpec(const std::string& spec) {
31 static int synthesized_monitor_id = 1000; 31 static int synthesized_monitor_id = 1000;
32 gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY, 32 gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY,
33 kDefaultHostWindowWidth, kDefaultHostWindowHeight); 33 kDefaultHostWindowWidth, kDefaultHostWindowHeight);
34 int x = 0, y = 0, width, height; 34 int x = 0, y = 0, width, height;
35 float scale = gfx::Display::GetDefaultDeviceScaleFactor(); 35 float scale = 1.0f;
36 if (sscanf(spec.c_str(), "%dx%d*%f", &width, &height, &scale) >= 2) { 36 if (sscanf(spec.c_str(), "%dx%d*%f", &width, &height, &scale) >= 2) {
37 bounds.set_size(gfx::Size(width, height)); 37 bounds.set_size(gfx::Size(width, height));
38 } else if (sscanf(spec.c_str(), "%d+%d-%dx%d*%f", &x, &y, &width, &height, 38 } else if (sscanf(spec.c_str(), "%d+%d-%dx%d*%f", &x, &y, &width, &height,
39 &scale) >= 4 ) { 39 &scale) >= 4 ) {
40 bounds = gfx::Rect(x, y, width, height); 40 bounds = gfx::Rect(x, y, width, height);
41 } else if (use_fullscreen_host_window_) { 41 } else if (use_fullscreen_host_window_) {
42 bounds = gfx::Rect(aura::RootWindowHost::GetNativeScreenSize()); 42 bounds = gfx::Rect(aura::RootWindowHost::GetNativeScreenSize());
43 } 43 }
44 gfx::Display display(synthesized_monitor_id++); 44 gfx::Display display(synthesized_monitor_id++);
45 display.SetScaleAndBounds(scale, bounds); 45 display.SetScaleAndBounds(scale, bounds);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 void MonitorManager::NotifyDisplayAdded(const gfx::Display& display) { 79 void MonitorManager::NotifyDisplayAdded(const gfx::Display& display) {
80 FOR_EACH_OBSERVER(DisplayObserver, observers_, OnDisplayAdded(display)); 80 FOR_EACH_OBSERVER(DisplayObserver, observers_, OnDisplayAdded(display));
81 } 81 }
82 82
83 void MonitorManager::NotifyDisplayRemoved(const gfx::Display& display) { 83 void MonitorManager::NotifyDisplayRemoved(const gfx::Display& display) {
84 FOR_EACH_OBSERVER(DisplayObserver, observers_, OnDisplayRemoved(display)); 84 FOR_EACH_OBSERVER(DisplayObserver, observers_, OnDisplayRemoved(display));
85 } 85 }
86 86
87 } // namespace aura 87 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/monitor_manager.h ('k') | ui/base/resource/resource_bundle_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698