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

Side by Side Diff: ui/base/l10n/l10n_util_win.cc

Issue 659883002: Enable hidpi on Linux, refactor a bit on Windows to share Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: constants Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base/l10n/l10n_util_win.h" 5 #include "ui/base/l10n/l10n_util_win.h"
6 6
7 #include <windowsx.h> 7 #include <windowsx.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <iterator> 9 #include <iterator>
10 10
11 #include "base/i18n/rtl.h" 11 #include "base/i18n/rtl.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/win/i18n.h" 16 #include "base/win/i18n.h"
17 #include "base/win/windows_version.h" 17 #include "base/win/windows_version.h"
18 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
19 #include "ui/gfx/display.h" 19 #include "ui/gfx/display.h"
20 #include "ui/gfx/win/dpi.h" 20 #include "ui/gfx/dpi.h"
21 #include "ui/strings/grit/app_locale_settings.h" 21 #include "ui/strings/grit/app_locale_settings.h"
22 22
23 namespace { 23 namespace {
24 24
25 void AdjustLogFont(const base::string16& font_family, 25 void AdjustLogFont(const base::string16& font_family,
26 double font_size_scaler, 26 double font_size_scaler,
27 double dpi_scale, 27 double dpi_scale,
28 LOGFONT* logfont) { 28 LOGFONT* logfont) {
29 DCHECK(font_size_scaler > 0); 29 DCHECK(font_size_scaler > 0);
30 font_size_scaler = std::max(std::min(font_size_scaler, 2.0), 0.7); 30 font_size_scaler = std::max(std::min(font_size_scaler, 2.0), 0.7);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } else { 196 } else {
197 NOTREACHED() << "Failed to determine the UI language for locale override."; 197 NOTREACHED() << "Failed to determine the UI language for locale override.";
198 } 198 }
199 } 199 }
200 200
201 const std::vector<std::string>& GetLocaleOverrides() { 201 const std::vector<std::string>& GetLocaleOverrides() {
202 return override_locale_holder.Get().value(); 202 return override_locale_holder.Get().value();
203 } 203 }
204 204
205 } // namespace l10n_util 205 } // namespace l10n_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698