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

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

Issue 731373002: Enable MSVC warning for unused locals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another Windows fix Created 6 years, 1 month 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/root_window_controller_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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/display/display_info.h" 9 #include "ash/display/display_info.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 89
90 // static 90 // static
91 void DisplayInfo::SetUse125DSFForUIScaling(bool enable) { 91 void DisplayInfo::SetUse125DSFForUIScaling(bool enable) {
92 use_125_dsf_for_ui_scaling = enable; 92 use_125_dsf_for_ui_scaling = enable;
93 } 93 }
94 94
95 // static 95 // static
96 DisplayInfo DisplayInfo::CreateFromSpecWithID(const std::string& spec, 96 DisplayInfo DisplayInfo::CreateFromSpecWithID(const std::string& spec,
97 int64 id) { 97 int64 id) {
98 // Default bounds for a display.
99 const int kDefaultHostWindowX = 200;
100 const int kDefaultHostWindowY = 200;
101 const int kDefaultHostWindowWidth = 1366;
102 const int kDefaultHostWindowHeight = 768;
103
104 // Use larger than max int to catch overflow early. 98 // Use larger than max int to catch overflow early.
105 static int64 synthesized_display_id = 2200000000LL; 99 static int64 synthesized_display_id = 2200000000LL;
106 100
107 #if defined(OS_WIN) 101 #if defined(OS_WIN)
108 gfx::Rect bounds_in_native(aura::WindowTreeHost::GetNativeScreenSize()); 102 gfx::Rect bounds_in_native(aura::WindowTreeHost::GetNativeScreenSize());
109 #else 103 #else
104 // Default bounds for a display.
105 const int kDefaultHostWindowX = 200;
106 const int kDefaultHostWindowY = 200;
107 const int kDefaultHostWindowWidth = 1366;
108 const int kDefaultHostWindowHeight = 768;
110 gfx::Rect bounds_in_native(kDefaultHostWindowX, kDefaultHostWindowY, 109 gfx::Rect bounds_in_native(kDefaultHostWindowX, kDefaultHostWindowY,
111 kDefaultHostWindowWidth, kDefaultHostWindowHeight); 110 kDefaultHostWindowWidth, kDefaultHostWindowHeight);
112 #endif 111 #endif
113 std::string main_spec = spec; 112 std::string main_spec = spec;
114 113
115 float ui_scale = 1.0f; 114 float ui_scale = 1.0f;
116 std::vector<std::string> parts; 115 std::vector<std::string> parts;
117 if (Tokenize(main_spec, "@", &parts) == 2) { 116 if (Tokenize(main_spec, "@", &parts) == 2) {
118 double scale_in_double = 0; 117 double scale_in_double = 0;
119 if (base::StringToDouble(parts[1], &scale_in_double)) 118 if (base::StringToDouble(parts[1], &scale_in_double))
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 return std::find(available_color_profiles_.begin(), 383 return std::find(available_color_profiles_.begin(),
385 available_color_profiles_.end(), 384 available_color_profiles_.end(),
386 profile) != available_color_profiles_.end(); 385 profile) != available_color_profiles_.end();
387 } 386 }
388 387
389 bool DisplayInfo::Use125DSFRorUIScaling() const { 388 bool DisplayInfo::Use125DSFRorUIScaling() const {
390 return use_125_dsf_for_ui_scaling && id_ == gfx::Display::InternalDisplayId(); 389 return use_125_dsf_for_ui_scaling && id_ == gfx::Display::InternalDisplayId();
391 } 390 }
392 391
393 } // namespace ash 392 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698