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

Unified Diff: Source/web/WebColorSuggestion.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/ColorChooserUIController.cpp ('k') | Source/web/web.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebColorSuggestion.cpp
diff --git a/Source/web/WebScriptBindings.cpp b/Source/web/WebColorSuggestion.cpp
similarity index 77%
copy from Source/web/WebScriptBindings.cpp
copy to Source/web/WebColorSuggestion.cpp
index 61b8a56a4e6e7fe186663b51bfd7c4a921448aff..ce51476ab36383ab1a6ee119ec09e6b471ae81eb 100644
--- a/Source/web/WebScriptBindings.cpp
+++ b/Source/web/WebColorSuggestion.cpp
@@ -29,23 +29,25 @@
*/
#include "config.h"
-#include "public/web/WebScriptBindings.h"
+#include "WebColorSuggestion.h"
-#include "bindings/v8/V8Binding.h"
+#include "platform/ColorSuggestion.h"
+#include "public/platform/WebColor.h"
#include "public/platform/WebString.h"
-using namespace WebCore;
-
namespace blink {
-v8::Local<v8::String> WebScriptBindings::toV8String(const WebString& string, v8::Isolate* isolate)
+WebColorSuggestion::WebColorSuggestion(const WebCore::ColorSuggestion& suggestion)
+ : color(static_cast<WebColor>(suggestion.color.rgb()))
+ , label(suggestion.label)
{
- return v8String(string, isolate);
}
-WebString WebScriptBindings::toWebString(v8::Handle<v8::String> v8String)
+WebColorSuggestion& WebColorSuggestion::operator=(const WebCore::ColorSuggestion& suggestion)
{
- return v8StringToWebCoreString<String>(v8String, Externalize);
+ color = static_cast<WebColor>(suggestion.color.rgb());
+ label = suggestion.label;
+ return *this;
}
} // namespace blink
« no previous file with comments | « Source/web/ColorChooserUIController.cpp ('k') | Source/web/web.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698