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

Side by Side Diff: chrome/browser/ui/libgtkui/gtk_ui.h

Issue 2441043002: [linux] Allow font to use below 1.0f scale (Closed)
Patch Set: Allow font to use below 1.0f scale Created 4 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 | chrome/browser/ui/libgtkui/gtk_ui.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 #ifndef CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_ 5 #ifndef CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_
6 #define CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_ 6 #define CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 views::WindowButtonOrderObserver* observer) override; 98 views::WindowButtonOrderObserver* observer) override;
99 bool UnityIsRunning() override; 99 bool UnityIsRunning() override;
100 NonClientMiddleClickAction GetNonClientMiddleClickAction() override; 100 NonClientMiddleClickAction GetNonClientMiddleClickAction() override;
101 void NotifyWindowManagerStartupComplete() override; 101 void NotifyWindowManagerStartupComplete() override;
102 102
103 // ui::TextEditKeybindingDelegate: 103 // ui::TextEditKeybindingDelegate:
104 bool MatchEvent(const ui::Event& event, 104 bool MatchEvent(const ui::Event& event,
105 std::vector<ui::TextEditCommandAuraLinux>* commands) override; 105 std::vector<ui::TextEditCommandAuraLinux>* commands) override;
106 106
107 // ui::Views::LinuxUI: 107 // ui::Views::LinuxUI:
108 void UpdateDeviceScaleFactor(float device_scale_factor) override; 108 void UpdateDeviceScaleFactor() override;
109 float GetDeviceScaleFactor() const override; 109 float GetDeviceScaleFactor() const override;
110 110
111 private: 111 private:
112 typedef std::map<int, SkColor> ColorMap; 112 typedef std::map<int, SkColor> ColorMap;
113 typedef std::map<int, color_utils::HSL> TintMap; 113 typedef std::map<int, color_utils::HSL> TintMap;
114 114
115 // This method returns the colors webkit will use for the scrollbars. When no 115 // This method returns the colors webkit will use for the scrollbars. When no
116 // colors are specified by the GTK+ theme, this function averages of the 116 // colors are specified by the GTK+ theme, this function averages of the
117 // thumb part and of the track colors. 117 // thumb part and of the track colors.
118 void SetScrollbarColors(); 118 void SetScrollbarColors();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 SkColor thumb_active_color_; 163 SkColor thumb_active_color_;
164 SkColor thumb_inactive_color_; 164 SkColor thumb_inactive_color_;
165 SkColor track_color_; 165 SkColor track_color_;
166 SkColor active_selection_bg_color_; 166 SkColor active_selection_bg_color_;
167 SkColor active_selection_fg_color_; 167 SkColor active_selection_fg_color_;
168 SkColor inactive_selection_bg_color_; 168 SkColor inactive_selection_bg_color_;
169 SkColor inactive_selection_fg_color_; 169 SkColor inactive_selection_fg_color_;
170 170
171 // Details about the default UI font. 171 // Details about the default UI font.
172 std::string default_font_family_; 172 std::string default_font_family_;
173 int default_font_size_pixels_; 173 int default_font_size_pixels_ = 0;
174 int default_font_style_; // Bitfield of gfx::Font::Style values. 174 // Bitfield of gfx::Font::Style values.
175 gfx::Font::Weight default_font_weight_; 175 int default_font_style_ = gfx::Font::NORMAL;
176 gfx::Font::Weight default_font_weight_ = gfx::Font::Weight::NORMAL;
176 gfx::FontRenderParams default_font_render_params_; 177 gfx::FontRenderParams default_font_render_params_;
177 178
178 #if defined(USE_GCONF) 179 #if defined(USE_GCONF)
179 // Currently, the only source of window button configuration. This will 180 // Currently, the only source of window button configuration. This will
180 // change if we ever have to support XFCE's configuration system or KDE's. 181 // change if we ever have to support XFCE's configuration system or KDE's.
181 std::unique_ptr<GConfListener> gconf_listener_; 182 std::unique_ptr<GConfListener> gconf_listener_;
182 #endif // defined(USE_GCONF) 183 #endif // defined(USE_GCONF)
183 184
184 // If either of these vectors are non-empty, they represent the current 185 // If either of these vectors are non-empty, they represent the current
185 // window button configuration. 186 // window button configuration.
186 std::vector<views::FrameButton> leading_buttons_; 187 std::vector<views::FrameButton> leading_buttons_;
187 std::vector<views::FrameButton> trailing_buttons_; 188 std::vector<views::FrameButton> trailing_buttons_;
188 189
189 std::unique_ptr<Gtk2KeyBindingsHandler> key_bindings_handler_; 190 std::unique_ptr<Gtk2KeyBindingsHandler> key_bindings_handler_;
190 191
191 // Objects to notify when the window frame button order changes. 192 // Objects to notify when the window frame button order changes.
192 base::ObserverList<views::WindowButtonOrderObserver> observer_list_; 193 base::ObserverList<views::WindowButtonOrderObserver> observer_list_;
193 194
194 // Whether we should lower the window on a middle click to the non client 195 // Whether we should lower the window on a middle click to the non client
195 // area. 196 // area.
196 NonClientMiddleClickAction middle_click_action_; 197 NonClientMiddleClickAction middle_click_action_;
197 198
198 // Used to override the native theme for a window. If no override is provided 199 // Used to override the native theme for a window. If no override is provided
199 // or the callback returns NULL, Gtk2UI will default to a NativeThemeGtk2 200 // or the callback returns NULL, Gtk2UI will default to a NativeThemeGtk2
200 // instance. 201 // instance.
201 NativeThemeGetter native_theme_overrider_; 202 NativeThemeGetter native_theme_overrider_;
202 203
203 float device_scale_factor_; 204 float device_scale_factor_ = 1.0f;
204 205
205 DISALLOW_COPY_AND_ASSIGN(Gtk2UI); 206 DISALLOW_COPY_AND_ASSIGN(Gtk2UI);
206 }; 207 };
207 208
208 } // namespace libgtkui 209 } // namespace libgtkui
209 210
210 // Access point to the GTK2 desktop system. This should be the only symbol that 211 // Access point to the GTK2 desktop system. This should be the only symbol that
211 // is exported in the library; everything else should be used through the 212 // is exported in the library; everything else should be used through the
212 // interface, because eventually this .so will be loaded through dlopen at 213 // interface, because eventually this .so will be loaded through dlopen at
213 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or 214 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or
214 // QT or whatever. 215 // QT or whatever.
215 LIBGTKUI_EXPORT views::LinuxUI* BuildGtk2UI(); 216 LIBGTKUI_EXPORT views::LinuxUI* BuildGtk2UI();
216 217
217 #endif // CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_ 218 #endif // CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/libgtkui/gtk_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698