OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 return m_itemIDs[listIndex] == WebAutofillClient::MenuItemIDWarningMessage; | 219 return m_itemIDs[listIndex] == WebAutofillClient::MenuItemIDWarningMessage; |
220 } | 220 } |
221 | 221 |
222 void AutofillPopupMenuClient::setTextFromItem(unsigned listIndex) | 222 void AutofillPopupMenuClient::setTextFromItem(unsigned listIndex) |
223 { | 223 { |
224 m_textField->setValue(getSuggestion(listIndex)); | 224 m_textField->setValue(getSuggestion(listIndex)); |
225 } | 225 } |
226 | 226 |
227 FontSelector* AutofillPopupMenuClient::fontSelector() const | 227 FontSelector* AutofillPopupMenuClient::fontSelector() const |
228 { | 228 { |
229 return m_textField->document().ensureStyleResolver().fontSelector(); | 229 return m_textField->document().styleEngine()->fontSelector(); |
230 } | 230 } |
231 | 231 |
232 HostWindow* AutofillPopupMenuClient::hostWindow() const | 232 HostWindow* AutofillPopupMenuClient::hostWindow() const |
233 { | 233 { |
234 return m_textField->document().view()->hostWindow(); | 234 return m_textField->document().view()->hostWindow(); |
235 } | 235 } |
236 | 236 |
237 PassRefPtr<Scrollbar> AutofillPopupMenuClient::createScrollbar( | 237 PassRefPtr<Scrollbar> AutofillPopupMenuClient::createScrollbar( |
238 ScrollableArea* scrollableArea, | 238 ScrollableArea* scrollableArea, |
239 ScrollbarOrientation orientation, | 239 ScrollbarOrientation orientation, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 setSuggestions(namesWithSeparator, labelsWithSeparator, iconsWithSeparat
or, itemIDsWithSeparator); | 278 setSuggestions(namesWithSeparator, labelsWithSeparator, iconsWithSeparat
or, itemIDsWithSeparator); |
279 } | 279 } |
280 | 280 |
281 FontDescription regularFontDescription; | 281 FontDescription regularFontDescription; |
282 RenderTheme::theme().systemFont(CSSValueWebkitControl, | 282 RenderTheme::theme().systemFont(CSSValueWebkitControl, |
283 regularFontDescription); | 283 regularFontDescription); |
284 RenderStyle* style = m_textField->computedStyle(); | 284 RenderStyle* style = m_textField->computedStyle(); |
285 regularFontDescription.setComputedSize(style->fontDescription().computedSize
()); | 285 regularFontDescription.setComputedSize(style->fontDescription().computedSize
()); |
286 | 286 |
287 Font regularFont(regularFontDescription, 0, 0); | 287 Font regularFont(regularFontDescription, 0, 0); |
288 regularFont.update(textField->document().ensureStyleResolver().fontSelector(
)); | 288 regularFont.update(textField->document().styleEngine()->fontSelector()); |
289 // The direction of text in popup menu is set the same as the direction of | 289 // The direction of text in popup menu is set the same as the direction of |
290 // the input element: textField. | 290 // the input element: textField. |
291 m_regularStyle = adoptPtr(new PopupMenuStyle(Color::black, Color::white, reg
ularFont, true, false, | 291 m_regularStyle = adoptPtr(new PopupMenuStyle(Color::black, Color::white, reg
ularFont, true, false, |
292 Length(WebCore::Fixed), textField->renderer()->style()->direction(), | 292 Length(WebCore::Fixed), textField->renderer()->style()->direction(), |
293 textField->renderer()->style()->unicodeBidi() == Override, | 293 textField->renderer()->style()->unicodeBidi() == Override, |
294 PopupMenuStyle::CustomBackgroundColor, PopupMenuStyle::AutofillPopup)); | 294 PopupMenuStyle::CustomBackgroundColor, PopupMenuStyle::AutofillPopup)); |
295 | 295 |
296 FontDescription warningFontDescription = regularFont.fontDescription(); | 296 FontDescription warningFontDescription = regularFont.fontDescription(); |
297 warningFontDescription.setItalic(true); | 297 warningFontDescription.setItalic(true); |
298 Font warningFont(warningFontDescription, regularFont.letterSpacing(), regula
rFont.wordSpacing()); | 298 Font warningFont(warningFontDescription, regularFont.letterSpacing(), regula
rFont.wordSpacing()); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // It seems we can only have a 0 style in a TextField if the | 341 // It seems we can only have a 0 style in a TextField if the |
342 // node is detached, in which case we the popup should not be | 342 // node is detached, in which case we the popup should not be |
343 // showing. Please report this in http://crbug.com/7708 and | 343 // showing. Please report this in http://crbug.com/7708 and |
344 // include the page you were visiting. | 344 // include the page you were visiting. |
345 ASSERT_NOT_REACHED(); | 345 ASSERT_NOT_REACHED(); |
346 } | 346 } |
347 return style; | 347 return style; |
348 } | 348 } |
349 | 349 |
350 } // namespace blink | 350 } // namespace blink |
OLD | NEW |