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

Side by Side Diff: Source/web/ColorChooserPopupUIController.cpp

Issue 23236002: Prepare for color input datalist support on Android (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Created 7 years, 3 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 | Annotate | Revision Log
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 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 closePopup(); 78 closePopup();
79 } 79 }
80 80
81 IntSize ColorChooserPopupUIController::contentSize() 81 IntSize ColorChooserPopupUIController::contentSize()
82 { 82 {
83 return IntSize(0, 0); 83 return IntSize(0, 0);
84 } 84 }
85 85
86 void ColorChooserPopupUIController::writeDocument(DocumentWriter& writer) 86 void ColorChooserPopupUIController::writeDocument(DocumentWriter& writer)
87 { 87 {
88 Vector<Color> suggestions = m_client->suggestions(); 88 Vector<ColorSuggestion> suggestions = m_client->suggestions();
89 Vector<String> suggestionValues; 89 Vector<String> suggestionValues;
90 for (unsigned i = 0; i < suggestions.size(); i++) 90 for (unsigned i = 0; i < suggestions.size(); i++)
91 suggestionValues.append(suggestions[i].serialized()); 91 suggestionValues.append(suggestions[i].valueAsColor.serialized());
92 IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_client->elem entRectRelativeToRootView()); 92 IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_client->elem entRectRelativeToRootView());
93 93
94 PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><styl e>\n", writer); 94 PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><styl e>\n", writer);
95 writer.addData(pickerCommonCss, sizeof(pickerCommonCss)); 95 writer.addData(pickerCommonCss, sizeof(pickerCommonCss));
96 writer.addData(colorSuggestionPickerCss, sizeof(colorSuggestionPickerCss)); 96 writer.addData(colorSuggestionPickerCss, sizeof(colorSuggestionPickerCss));
97 PagePopupClient::addString("</style></head><body><div id=main>Loading...</di v><script>\n" 97 PagePopupClient::addString("</style></head><body><div id=main>Loading...</di v><script>\n"
98 "window.dialogArguments = {\n", writer); 98 "window.dialogArguments = {\n", writer);
99 PagePopupClient::addProperty("values", suggestionValues, writer); 99 PagePopupClient::addProperty("values", suggestionValues, writer);
100 PagePopupClient::addProperty("otherColorLabel", Platform::current()->queryLo calizedString(WebLocalizedString::OtherColorLabel), writer); 100 PagePopupClient::addProperty("otherColorLabel", Platform::current()->queryLo calizedString(WebLocalizedString::OtherColorLabel), writer);
101 addProperty("anchorRectInScreen", anchorRectInScreen, writer); 101 addProperty("anchorRectInScreen", anchorRectInScreen, writer);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 143 }
144 144
145 void ColorChooserPopupUIController::closePopup() 145 void ColorChooserPopupUIController::closePopup()
146 { 146 {
147 if (!m_popup) 147 if (!m_popup)
148 return; 148 return;
149 m_chromeClient->closePagePopup(m_popup); 149 m_chromeClient->closePagePopup(m_popup);
150 } 150 }
151 151
152 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698