equal
deleted
inserted
replaced
34 #include "Settings.h" |
34 #include "Settings.h" |
35 #include "FormFillCallback.h" |
35 #include "FormFillCallback.h" |
36 #include "FormFillPopup.h" |
36 #include "FormFillPopup.h" |
37 #include "PlatformFontCache.h" |
37 #include "PlatformFontCache.h" |
38 #include "StaticObjectsContainer.h" |
38 #include "StaticObjectsContainer.h" |
|
39 #include "FontDescription.h" |
|
40 |
|
41 #define KMaxZoomFactorForPopup 125 |
39 namespace WebCore { |
42 namespace WebCore { |
40 |
43 |
41 static const double kSearchStartTimeout = 0.5f; |
44 static const double kSearchStartTimeout = 0.5f; |
42 |
45 |
43 FormFillController::FormFillController() |
46 FormFillController::FormFillController() |
78 float zoomFactor = (float)cache->fontZoomFactor(); |
81 float zoomFactor = (float)cache->fontZoomFactor(); |
79 if(!m_popup) { |
82 if(!m_popup) { |
80 // system font to be used by popup |
83 // system font to be used by popup |
81 |
84 |
82 float newFont = 12.0f * zoomFactor /100.0f; |
85 float newFont = 12.0f * zoomFactor /100.0f; |
83 FontPlatformData* font = FontCache::getDeviceDefaultFont(newFont); |
86 FontDescription fd; |
|
87 fd.setComputedSize(newFont); |
|
88 //If zoom factor is greater than 120 and less than or equals 200, then make it 125 by default. This |
|
89 //will make it selectable not too big. |
|
90 FontPlatformData* font = new FontPlatformData(cache->zoomedFont(fd, (zoomFactor > 120)? KMaxZoomFactorForPopup : zoomFactor));; |
84 m_popup = m_callback->createFormFillPopup(font->Font()); |
91 m_popup = m_callback->createFormFillPopup(font->Font()); |
|
92 delete font; |
85 } |
93 } |
86 if (!m_popup) { |
94 if (!m_popup) { |
87 return; |
95 return; |
88 } |
96 } |
89 m_popup->clear(); |
97 m_popup->clear(); |