| OLD | NEW |
| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 { | 94 { |
| 95 return m_popup ? m_popup->rootAXObject() : nullptr; | 95 return m_popup ? m_popup->rootAXObject() : nullptr; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void ColorChooserPopupUIController::writeDocument(SharedBuffer* data) | 98 void ColorChooserPopupUIController::writeDocument(SharedBuffer* data) |
| 99 { | 99 { |
| 100 Vector<ColorSuggestion> suggestions = m_client->suggestions(); | 100 Vector<ColorSuggestion> suggestions = m_client->suggestions(); |
| 101 Vector<String> suggestionValues; | 101 Vector<String> suggestionValues; |
| 102 for (unsigned i = 0; i < suggestions.size(); i++) | 102 for (unsigned i = 0; i < suggestions.size(); i++) |
| 103 suggestionValues.append(suggestions[i].color.serialized()); | 103 suggestionValues.append(suggestions[i].color.serialized()); |
| 104 IntRect anchorRectInScreen = m_chromeClient->viewportToScreen(m_client->elem
entRectRelativeToViewport()); | 104 IntRect anchorRectInScreen = m_chromeClient->viewportToScreen(m_client->elem
entRectRelativeToViewport(), m_frame->view()); |
| 105 | 105 |
| 106 PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><styl
e>\n", data); | 106 PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><styl
e>\n", data); |
| 107 data->append(Platform::current()->loadResource("pickerCommon.css")); | 107 data->append(Platform::current()->loadResource("pickerCommon.css")); |
| 108 data->append(Platform::current()->loadResource("colorSuggestionPicker.css"))
; | 108 data->append(Platform::current()->loadResource("colorSuggestionPicker.css"))
; |
| 109 PagePopupClient::addString("</style></head><body><div id=main>Loading...</di
v><script>\n" | 109 PagePopupClient::addString("</style></head><body><div id=main>Loading...</di
v><script>\n" |
| 110 "window.dialogArguments = {\n", data); | 110 "window.dialogArguments = {\n", data); |
| 111 PagePopupClient::addProperty("values", suggestionValues, data); | 111 PagePopupClient::addProperty("values", suggestionValues, data); |
| 112 PagePopupClient::addProperty("otherColorLabel", locale().queryString(WebLoca
lizedString::OtherColorLabel), data); | 112 PagePopupClient::addProperty("otherColorLabel", locale().queryString(WebLoca
lizedString::OtherColorLabel), data); |
| 113 addProperty("anchorRectInScreen", anchorRectInScreen, data); | 113 addProperty("anchorRectInScreen", anchorRectInScreen, data); |
| 114 addProperty("zoomFactor", zoomFactor(), data); | 114 addProperty("zoomFactor", zoomFactor(), data); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ColorChooserPopupUIController::closePopup() | 165 void ColorChooserPopupUIController::closePopup() |
| 166 { | 166 { |
| 167 if (!m_popup) | 167 if (!m_popup) |
| 168 return; | 168 return; |
| 169 m_chromeClient->closePagePopup(m_popup); | 169 m_chromeClient->closePagePopup(m_popup); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace blink | 172 } // namespace blink |
| OLD | NEW |