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

Side by Side Diff: chrome/views/controls/menu/chrome_menu.cc

Issue 62064: UI font localization part 2 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/win_util.cc ('k') | chrome/views/controls/menu/menu.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/controls/menu/chrome_menu.h" 5 #include "chrome/views/controls/menu/chrome_menu.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <uxtheme.h> 8 #include <uxtheme.h>
9 #include <Vssym32.h> 9 #include <Vssym32.h>
10 10
11 #include "base/base_drag_source.h" 11 #include "base/base_drag_source.h"
12 #include "base/gfx/native_theme.h" 12 #include "base/gfx/native_theme.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "base/task.h" 14 #include "base/task.h"
15 #include "base/timer.h" 15 #include "base/timer.h"
16 #include "base/win_util.h" 16 #include "base/win_util.h"
17 // TODO(beng): (Cleanup) remove this browser dep. 17 // TODO(beng): (Cleanup) remove this browser dep.
18 #include "chrome/browser/drag_utils.h" 18 #include "chrome/browser/drag_utils.h"
19 #include "chrome/common/gfx/chrome_canvas.h" 19 #include "chrome/common/gfx/chrome_canvas.h"
20 #include "chrome/common/gfx/color_utils.h" 20 #include "chrome/common/gfx/color_utils.h"
21 #include "chrome/common/l10n_util.h" 21 #include "chrome/common/l10n_util.h"
22 #include "chrome/common/l10n_util_win.h"
22 #include "chrome/common/os_exchange_data.h" 23 #include "chrome/common/os_exchange_data.h"
23 #include "chrome/views/border.h" 24 #include "chrome/views/border.h"
24 #include "chrome/views/view_constants.h" 25 #include "chrome/views/view_constants.h"
25 #include "chrome/views/widget/root_view.h" 26 #include "chrome/views/widget/root_view.h"
26 #include "chrome/views/widget/widget_win.h" 27 #include "chrome/views/widget/widget_win.h"
27 #include "grit/generated_resources.h" 28 #include "grit/generated_resources.h"
28 #include "skia/ext/skia_utils_win.h" 29 #include "skia/ext/skia_utils_win.h"
29 30
30 #undef min 31 #undef min
31 #undef max 32 #undef max
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 123
123 namespace views { 124 namespace views {
124 125
125 namespace { 126 namespace {
126 127
127 // Returns the font menus are to use. 128 // Returns the font menus are to use.
128 ChromeFont GetMenuFont() { 129 ChromeFont GetMenuFont() {
129 NONCLIENTMETRICS metrics; 130 NONCLIENTMETRICS metrics;
130 win_util::GetNonClientMetrics(&metrics); 131 win_util::GetNonClientMetrics(&metrics);
131 132
133 l10n_util::AdjustUIFont(&(metrics.lfMenuFont));
132 HFONT font = CreateFontIndirect(&metrics.lfMenuFont); 134 HFONT font = CreateFontIndirect(&metrics.lfMenuFont);
133 DLOG_ASSERT(font); 135 DLOG_ASSERT(font);
134 return ChromeFont::CreateFont(font); 136 return ChromeFont::CreateFont(font);
135 } 137 }
136 138
137 // Calculates all sizes that we can from the OS. 139 // Calculates all sizes that we can from the OS.
138 // 140 //
139 // This is invoked prior to Running a menu. 141 // This is invoked prior to Running a menu.
140 void UpdateMenuPartSizes(bool has_icons) { 142 void UpdateMenuPartSizes(bool has_icons) {
141 HDC dc = GetDC(NULL); 143 HDC dc = GetDC(NULL);
(...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 if (!scroll_task_.get()) 2816 if (!scroll_task_.get())
2815 scroll_task_.reset(new MenuScrollTask()); 2817 scroll_task_.reset(new MenuScrollTask());
2816 scroll_task_->Update(part); 2818 scroll_task_->Update(part);
2817 } 2819 }
2818 2820
2819 void MenuController::StopScrolling() { 2821 void MenuController::StopScrolling() {
2820 scroll_task_.reset(NULL); 2822 scroll_task_.reset(NULL);
2821 } 2823 }
2822 2824
2823 } // namespace views 2825 } // namespace views
OLDNEW
« no previous file with comments | « chrome/common/win_util.cc ('k') | chrome/views/controls/menu/menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698