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

Side by Side Diff: ui/views/widget/widget.cc

Issue 1689623004: Start removing enum ui::ResourceBundle::FontStyle, fix MacViews font sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix transcription error Created 4 years, 10 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
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | 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/views/widget/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "base/trace_event/trace_event.h" 11 #include "base/trace_event/trace_event.h"
12 #include "ui/base/cursor/cursor.h" 12 #include "ui/base/cursor/cursor.h"
13 #include "ui/base/default_style.h"
13 #include "ui/base/default_theme_provider.h" 14 #include "ui/base/default_theme_provider.h"
14 #include "ui/base/hit_test.h" 15 #include "ui/base/hit_test.h"
15 #include "ui/base/ime/input_method.h" 16 #include "ui/base/ime/input_method.h"
16 #include "ui/base/l10n/l10n_font_util.h" 17 #include "ui/base/l10n/l10n_font_util.h"
17 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
18 #include "ui/compositor/compositor.h" 19 #include "ui/compositor/compositor.h"
19 #include "ui/compositor/layer.h" 20 #include "ui/compositor/layer.h"
20 #include "ui/events/event.h" 21 #include "ui/events/event.h"
21 #include "ui/events/event_utils.h" 22 #include "ui/events/event_utils.h"
22 #include "ui/gfx/image/image_skia.h" 23 #include "ui/gfx/image/image_skia.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 268 }
268 269
269 // static 270 // static
270 void Widget::ReparentNativeView(gfx::NativeView native_view, 271 void Widget::ReparentNativeView(gfx::NativeView native_view,
271 gfx::NativeView new_parent) { 272 gfx::NativeView new_parent) {
272 internal::NativeWidgetPrivate::ReparentNativeView(native_view, new_parent); 273 internal::NativeWidgetPrivate::ReparentNativeView(native_view, new_parent);
273 } 274 }
274 275
275 // static 276 // static
276 int Widget::GetLocalizedContentsWidth(int col_resource_id) { 277 int Widget::GetLocalizedContentsWidth(int col_resource_id) {
277 return ui::GetLocalizedContentsWidthForFont(col_resource_id, 278 return ui::GetLocalizedContentsWidthForFont(
278 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); 279 col_resource_id, ResourceBundle::GetSharedInstance().GetFontWithDelta(
280 ui::kMessageFontSizeDelta));
279 } 281 }
280 282
281 // static 283 // static
282 int Widget::GetLocalizedContentsHeight(int row_resource_id) { 284 int Widget::GetLocalizedContentsHeight(int row_resource_id) {
283 return ui::GetLocalizedContentsHeightForFont(row_resource_id, 285 return ui::GetLocalizedContentsHeightForFont(
284 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); 286 row_resource_id, ResourceBundle::GetSharedInstance().GetFontWithDelta(
287 ui::kMessageFontSizeDelta));
285 } 288 }
286 289
287 // static 290 // static
288 gfx::Size Widget::GetLocalizedContentsSize(int col_resource_id, 291 gfx::Size Widget::GetLocalizedContentsSize(int col_resource_id,
289 int row_resource_id) { 292 int row_resource_id) {
290 return gfx::Size(GetLocalizedContentsWidth(col_resource_id), 293 return gfx::Size(GetLocalizedContentsWidth(col_resource_id),
291 GetLocalizedContentsHeight(row_resource_id)); 294 GetLocalizedContentsHeight(row_resource_id));
292 } 295 }
293 296
294 // static 297 // static
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 1490
1488 //////////////////////////////////////////////////////////////////////////////// 1491 ////////////////////////////////////////////////////////////////////////////////
1489 // internal::NativeWidgetPrivate, NativeWidget implementation: 1492 // internal::NativeWidgetPrivate, NativeWidget implementation:
1490 1493
1491 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1494 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1492 return this; 1495 return this;
1493 } 1496 }
1494 1497
1495 } // namespace internal 1498 } // namespace internal
1496 } // namespace views 1499 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698