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

Unified Diff: Source/core/frame/SmartClip.cpp

Issue 266193003: Revert of Fix to remove customised String over IPC for SmartClip (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/SmartClip.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/SmartClip.cpp
diff --git a/Source/core/frame/SmartClip.cpp b/Source/core/frame/SmartClip.cpp
index 790b07cd73b3214e69543460fdc4d9149029cdc2..3a95095c06e4ef057ba19fe6b31f9962b2223556 100644
--- a/Source/core/frame/SmartClip.cpp
+++ b/Source/core/frame/SmartClip.cpp
@@ -61,14 +61,33 @@
return 0;
}
-IntRect SmartClipData::getRect() const
-{
- return m_rect;
-}
-
-String SmartClipData::getClipData() const
-{
- return m_string;
+// FIXME: SmartClipData is eventually returned via
+// SLookSmartClip.DataExtractionListener:
+// http://img-developer.samsung.com/onlinedocs/sms/com/samsung/android/sdk/look/...
+// however the original author of this change chose to use a string-serialization
+// format (presumably to make IPC easy?).
+// If we're going to use this as a Pickle format, we should at least have the
+// read/write code in one place!
+String SmartClipData::toString()
+{
+ if (!m_node)
+ return emptyString();
+
+ const UChar fieldSeparator = 0xFFFE;
+ const UChar rowSeparator = 0xFFFF;
+
+ StringBuilder result;
+ result.append(String::number(m_rect.x()));
+ result.append(fieldSeparator);
+ result.append(String::number(m_rect.y()));
+ result.append(fieldSeparator);
+ result.append(String::number(m_rect.width()));
+ result.append(fieldSeparator);
+ result.append(String::number(m_rect.height()));
+ result.append(fieldSeparator);
+ result.append(m_string);
+ result.append(rowSeparator);
+ return result.toString();
}
SmartClip::SmartClip(PassRefPtr<LocalFrame> frame)
« no previous file with comments | « Source/core/frame/SmartClip.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698