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

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: Created 7 years, 1 month 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
« no previous file with comments | « Source/web/ChromeClientImpl.cpp ('k') | Source/web/ColorChooserUIController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 closePopup(); 75 closePopup();
76 } 76 }
77 77
78 IntSize ColorChooserPopupUIController::contentSize() 78 IntSize ColorChooserPopupUIController::contentSize()
79 { 79 {
80 return IntSize(0, 0); 80 return IntSize(0, 0);
81 } 81 }
82 82
83 void ColorChooserPopupUIController::writeDocument(DocumentWriter& writer) 83 void ColorChooserPopupUIController::writeDocument(DocumentWriter& writer)
84 { 84 {
85 Vector<Color> suggestions = m_client->suggestions(); 85 Vector<ColorSuggestion> suggestions = m_client->suggestions();
86 Vector<String> suggestionValues; 86 Vector<String> suggestionValues;
87 for (unsigned i = 0; i < suggestions.size(); i++) 87 for (unsigned i = 0; i < suggestions.size(); i++)
88 suggestionValues.append(suggestions[i].serialized()); 88 suggestionValues.append(suggestions[i].color.serialized());
89 IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_client->elem entRectRelativeToRootView()); 89 IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_client->elem entRectRelativeToRootView());
90 90
91 PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><styl e>\n", writer); 91 PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><styl e>\n", writer);
92 writer.addData(pickerCommonCss, sizeof(pickerCommonCss)); 92 writer.addData(pickerCommonCss, sizeof(pickerCommonCss));
93 writer.addData(colorSuggestionPickerCss, sizeof(colorSuggestionPickerCss)); 93 writer.addData(colorSuggestionPickerCss, sizeof(colorSuggestionPickerCss));
94 PagePopupClient::addString("</style></head><body><div id=main>Loading...</di v><script>\n" 94 PagePopupClient::addString("</style></head><body><div id=main>Loading...</di v><script>\n"
95 "window.dialogArguments = {\n", writer); 95 "window.dialogArguments = {\n", writer);
96 PagePopupClient::addProperty("values", suggestionValues, writer); 96 PagePopupClient::addProperty("values", suggestionValues, writer);
97 PagePopupClient::addProperty("otherColorLabel", locale().queryString(WebLoca lizedString::OtherColorLabel), writer); 97 PagePopupClient::addProperty("otherColorLabel", locale().queryString(WebLoca lizedString::OtherColorLabel), writer);
98 addProperty("anchorRectInScreen", anchorRectInScreen, writer); 98 addProperty("anchorRectInScreen", anchorRectInScreen, writer);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 void ColorChooserPopupUIController::closePopup() 142 void ColorChooserPopupUIController::closePopup()
143 { 143 {
144 if (!m_popup) 144 if (!m_popup)
145 return; 145 return;
146 m_chromeClient->closePagePopup(m_popup); 146 m_chromeClient->closePagePopup(m_popup);
147 } 147 }
148 148
149 } 149 }
OLDNEW
« no previous file with comments | « Source/web/ChromeClientImpl.cpp ('k') | Source/web/ColorChooserUIController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698