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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_popup_view_win.h

Issue 113441: ChromeFont->gfx::Font... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: Created 11 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) 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_WIN_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_WIN_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_WIN_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_WIN_H_
7 7
8 #include <atlbase.h> 8 #include <atlbase.h>
9 #include <atlapp.h> 9 #include <atlapp.h>
10 #include <atlcrack.h> 10 #include <atlcrack.h>
(...skipping 30 matching lines...) Expand all
41 MSG_WM_LBUTTONDOWN(OnLButtonDown) 41 MSG_WM_LBUTTONDOWN(OnLButtonDown)
42 MSG_WM_MBUTTONDOWN(OnMButtonDown) 42 MSG_WM_MBUTTONDOWN(OnMButtonDown)
43 MSG_WM_LBUTTONUP(OnLButtonUp) 43 MSG_WM_LBUTTONUP(OnLButtonUp)
44 MSG_WM_MBUTTONUP(OnMButtonUp) 44 MSG_WM_MBUTTONUP(OnMButtonUp)
45 MSG_WM_MOUSEACTIVATE(OnMouseActivate) 45 MSG_WM_MOUSEACTIVATE(OnMouseActivate)
46 MSG_WM_MOUSELEAVE(OnMouseLeave) 46 MSG_WM_MOUSELEAVE(OnMouseLeave)
47 MSG_WM_MOUSEMOVE(OnMouseMove) 47 MSG_WM_MOUSEMOVE(OnMouseMove)
48 MSG_WM_PAINT(OnPaint) 48 MSG_WM_PAINT(OnPaint)
49 END_MSG_MAP() 49 END_MSG_MAP()
50 50
51 AutocompletePopupViewWin(const ChromeFont& font, 51 AutocompletePopupViewWin(const gfx::Font& font,
52 AutocompleteEditViewWin* edit_view, 52 AutocompleteEditViewWin* edit_view,
53 AutocompleteEditModel* edit_model, 53 AutocompleteEditModel* edit_model,
54 Profile* profile); 54 Profile* profile);
55 55
56 // Returns true if the popup is currently open. 56 // Returns true if the popup is currently open.
57 virtual bool IsOpen() const { return m_hWnd != NULL; } 57 virtual bool IsOpen() const { return m_hWnd != NULL; }
58 58
59 // Invalidates one line of the autocomplete popup. 59 // Invalidates one line of the autocomplete popup.
60 virtual void InvalidateLine(size_t line); 60 virtual void InvalidateLine(size_t line);
61 61
(...skipping 13 matching lines...) Expand all
75 75
76 // Caches GDI objects and information for drawing. 76 // Caches GDI objects and information for drawing.
77 struct DrawLineInfo { 77 struct DrawLineInfo {
78 enum LineStatus { 78 enum LineStatus {
79 NORMAL = 0, 79 NORMAL = 0,
80 HOVERED, 80 HOVERED,
81 SELECTED, 81 SELECTED,
82 MAX_STATUS_ENTRIES 82 MAX_STATUS_ENTRIES
83 }; 83 };
84 84
85 explicit DrawLineInfo(const ChromeFont& font); 85 explicit DrawLineInfo(const gfx::Font& font);
86 ~DrawLineInfo(); 86 ~DrawLineInfo();
87 87
88 static COLORREF AlphaBlend(COLORREF foreground, 88 static COLORREF AlphaBlend(COLORREF foreground,
89 COLORREF background, 89 COLORREF background,
90 BYTE alpha); 90 BYTE alpha);
91 91
92 static const wchar_t ellipsis_str[]; 92 static const wchar_t ellipsis_str[];
93 93
94 ChromeFont regular_font; // Fonts used for rendering AutocompleteMatches. 94 gfx::Font regular_font; // Fonts used for rendering AutocompleteMatches.
95 ChromeFont bold_font; 95 gfx::Font bold_font;
96 int font_height; // Height (in pixels) of a line of text w/o 96 int font_height; // Height (in pixels) of a line of text w/o
97 // padding. 97 // padding.
98 int line_height; // Height (in pixels) of a line of text w/padding. 98 int line_height; // Height (in pixels) of a line of text w/padding.
99 int ave_char_width; // Width (in pixels) of an average character of 99 int ave_char_width; // Width (in pixels) of an average character of
100 // the regular font. 100 // the regular font.
101 int ellipsis_width; // Width (in pixels) of the ellipsis_str. 101 int ellipsis_width; // Width (in pixels) of the ellipsis_str.
102 102
103 // colors 103 // colors
104 COLORREF background_colors[MAX_STATUS_ENTRIES]; 104 COLORREF background_colors[MAX_STATUS_ENTRIES];
105 COLORREF text_colors[MAX_STATUS_ENTRIES]; 105 COLORREF text_colors[MAX_STATUS_ENTRIES];
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // mouse position when hover tracking was turned off. If the mouse moves to a 201 // mouse position when hover tracking was turned off. If the mouse moves to a
202 // point over the popup that has different coordinates, hover tracking will be 202 // point over the popup that has different coordinates, hover tracking will be
203 // re-enabled. When hovered_line_ is a valid line, the value here is 203 // re-enabled. When hovered_line_ is a valid line, the value here is
204 // out-of-date and should be ignored. 204 // out-of-date and should be ignored.
205 CPoint last_hover_coordinates_; 205 CPoint last_hover_coordinates_;
206 206
207 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewWin); 207 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewWin);
208 }; 208 };
209 209
210 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_WIN_H_ 210 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_WIN_H_
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc ('k') | chrome/browser/autocomplete/autocomplete_popup_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698