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

Side by Side Diff: third_party/WebKit/Source/web/DateTimeChooserImpl.cpp

Issue 1456753002: Compute the popup location/size correctly when use-zoom-for-dsf is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update TestExpectations Created 5 years 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 123
124 addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", data); 124 addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", data);
125 data->append(Platform::current()->loadResource("pickerCommon.css")); 125 data->append(Platform::current()->loadResource("pickerCommon.css"));
126 data->append(Platform::current()->loadResource("pickerButton.css")); 126 data->append(Platform::current()->loadResource("pickerButton.css"));
127 data->append(Platform::current()->loadResource("suggestionPicker.css")); 127 data->append(Platform::current()->loadResource("suggestionPicker.css"));
128 data->append(Platform::current()->loadResource("calendarPicker.css")); 128 data->append(Platform::current()->loadResource("calendarPicker.css"));
129 addString("</style></head><body><div id=main>Loading...</div><script>\n" 129 addString("</style></head><body><div id=main>Loading...</div><script>\n"
130 "window.dialogArguments = {\n", data); 130 "window.dialogArguments = {\n", data);
131 addProperty("anchorRectInScreen", m_parameters.anchorRectInScreen, data); 131 addProperty("anchorRectInScreen", m_parameters.anchorRectInScreen, data);
132 addProperty("zoomFactor", zoomFactor(), data); 132 IntRect inScreen = m_chromeClient->viewportToScreen(IntRect(0, 0, 100, 0));
133 float scaleFactor = 100.f / inScreen.width();
134 addProperty("zoomFactor", zoomFactor() / scaleFactor, data);
133 addProperty("min", valueToDateTimeString(m_parameters.minimum, m_parameters. type), data); 135 addProperty("min", valueToDateTimeString(m_parameters.minimum, m_parameters. type), data);
134 addProperty("max", valueToDateTimeString(m_parameters.maximum, m_parameters. type), data); 136 addProperty("max", valueToDateTimeString(m_parameters.maximum, m_parameters. type), data);
135 addProperty("step", stepString, data); 137 addProperty("step", stepString, data);
136 addProperty("stepBase", stepBaseString, data); 138 addProperty("stepBase", stepBaseString, data);
137 addProperty("required", m_parameters.required, data); 139 addProperty("required", m_parameters.required, data);
138 addProperty("currentValue", valueToDateTimeString(m_parameters.doubleValue, m_parameters.type), data); 140 addProperty("currentValue", valueToDateTimeString(m_parameters.doubleValue, m_parameters.type), data);
139 addProperty("locale", m_parameters.locale.string(), data); 141 addProperty("locale", m_parameters.locale.string(), data);
140 addProperty("todayLabel", todayLabelString, data); 142 addProperty("todayLabel", todayLabelString, data);
141 addProperty("clearLabel", locale().queryString(WebLocalizedString::CalendarC lear), data); 143 addProperty("clearLabel", locale().queryString(WebLocalizedString::CalendarC lear), data);
142 addProperty("weekLabel", locale().queryString(WebLocalizedString::WeekNumber Label), data); 144 addProperty("weekLabel", locale().queryString(WebLocalizedString::WeekNumber Label), data);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 void DateTimeChooserImpl::didClosePopup() 208 void DateTimeChooserImpl::didClosePopup()
207 { 209 {
208 ASSERT(m_client); 210 ASSERT(m_client);
209 m_popup = nullptr; 211 m_popup = nullptr;
210 m_client->didEndChooser(); 212 m_client->didEndChooser();
211 } 213 }
212 214
213 } // namespace blink 215 } // namespace blink
214 216
215 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) 217 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698