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

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 1920263003: Rename gfx::Display/Screen to display::Display/Screen in chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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) 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 "chrome/browser/ui/libgtk2ui/gtk2_ui.h" 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <pango/pango.h> 8 #include <pango/pango.h>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 23 matching lines...) Expand all
34 #include "chrome/browser/ui/libgtk2ui/unity_service.h" 34 #include "chrome/browser/ui/libgtk2ui/unity_service.h"
35 #include "chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h" 35 #include "chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h"
36 #include "grit/components_scaled_resources.h" 36 #include "grit/components_scaled_resources.h"
37 #include "grit/theme_resources.h" 37 #include "grit/theme_resources.h"
38 #include "third_party/skia/include/core/SkBitmap.h" 38 #include "third_party/skia/include/core/SkBitmap.h"
39 #include "third_party/skia/include/core/SkCanvas.h" 39 #include "third_party/skia/include/core/SkCanvas.h"
40 #include "third_party/skia/include/core/SkColor.h" 40 #include "third_party/skia/include/core/SkColor.h"
41 #include "third_party/skia/include/core/SkShader.h" 41 #include "third_party/skia/include/core/SkShader.h"
42 #include "ui/base/material_design/material_design_controller.h" 42 #include "ui/base/material_design/material_design_controller.h"
43 #include "ui/base/resource/resource_bundle.h" 43 #include "ui/base/resource/resource_bundle.h"
44 #include "ui/display/display.h"
44 #include "ui/gfx/canvas.h" 45 #include "ui/gfx/canvas.h"
45 #include "ui/gfx/display.h"
46 #include "ui/gfx/geometry/rect.h" 46 #include "ui/gfx/geometry/rect.h"
47 #include "ui/gfx/geometry/size.h" 47 #include "ui/gfx/geometry/size.h"
48 #include "ui/gfx/image/image.h" 48 #include "ui/gfx/image/image.h"
49 #include "ui/gfx/image/image_skia_source.h" 49 #include "ui/gfx/image/image_skia_source.h"
50 #include "ui/gfx/skbitmap_operations.h" 50 #include "ui/gfx/skbitmap_operations.h"
51 #include "ui/gfx/skia_util.h" 51 #include "ui/gfx/skia_util.h"
52 #include "ui/native_theme/native_theme.h" 52 #include "ui/native_theme/native_theme.h"
53 #include "ui/resources/grit/ui_resources.h" 53 #include "ui/resources/grit/ui_resources.h"
54 #include "ui/views/controls/button/blue_button.h" 54 #include "ui/views/controls/button/blue_button.h"
55 #include "ui/views/controls/button/label_button.h" 55 #include "ui/views/controls/button/label_button.h"
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 UpdateMaterialDesignColors(); 1375 UpdateMaterialDesignColors();
1376 NativeThemeGtk2::instance()->NotifyObservers(); 1376 NativeThemeGtk2::instance()->NotifyObservers();
1377 } 1377 }
1378 1378
1379 void Gtk2UI::UpdateDeviceScaleFactor(float device_scale_factor) { 1379 void Gtk2UI::UpdateDeviceScaleFactor(float device_scale_factor) {
1380 device_scale_factor_ = device_scale_factor; 1380 device_scale_factor_ = device_scale_factor;
1381 UpdateDefaultFont(); 1381 UpdateDefaultFont();
1382 } 1382 }
1383 1383
1384 float Gtk2UI::GetDeviceScaleFactor() const { 1384 float Gtk2UI::GetDeviceScaleFactor() const {
1385 if (gfx::Display::HasForceDeviceScaleFactor()) 1385 if (display::Display::HasForceDeviceScaleFactor())
1386 return gfx::Display::GetForcedDeviceScaleFactor(); 1386 return display::Display::GetForcedDeviceScaleFactor();
1387 const int kCSSDefaultDPI = 96; 1387 const int kCSSDefaultDPI = 96;
1388 const float scale = GetDPI() / kCSSDefaultDPI; 1388 const float scale = GetDPI() / kCSSDefaultDPI;
1389 1389
1390 // Blacklist scaling factors <130% (crbug.com/484400) and round 1390 // Blacklist scaling factors <130% (crbug.com/484400) and round
1391 // to 1 decimal to prevent rendering problems (crbug.com/485183). 1391 // to 1 decimal to prevent rendering problems (crbug.com/485183).
1392 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; 1392 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10;
1393 } 1393 }
1394 1394
1395 } // namespace libgtk2ui 1395 } // namespace libgtk2ui
1396 1396
1397 views::LinuxUI* BuildGtk2UI() { 1397 views::LinuxUI* BuildGtk2UI() {
1398 return new libgtk2ui::Gtk2UI; 1398 return new libgtk2ui::Gtk2UI;
1399 } 1399 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ime/ime_window.cc ('k') | chrome/browser/ui/panels/display_settings_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698