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

Unified Diff: chrome/browser/ui/android/omnibox/omnibox_view_util.cc

Issue 298523002: [Android] Use the omnibox paste sanitizing code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra blank line 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 | « chrome/browser/ui/android/omnibox/omnibox_view_util.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/omnibox/omnibox_view_util.cc
diff --git a/chrome/browser/ui/android/omnibox/omnibox_view_util.cc b/chrome/browser/ui/android/omnibox/omnibox_view_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..73924fcfb4e623616423c969a020e52f73457c26
--- /dev/null
+++ b/chrome/browser/ui/android/omnibox/omnibox_view_util.cc
@@ -0,0 +1,22 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/android/omnibox/omnibox_view_util.h"
+
+#include "base/android/jni_string.h"
+#include "chrome/browser/ui/omnibox/omnibox_view.h"
+#include "jni/OmniboxViewUtil_jni.h"
+
+// static
+jstring SanitizeTextForPaste(JNIEnv* env, jclass clazz, jstring jtext) {
+ base::string16 pasted_text(
+ base::android::ConvertJavaStringToUTF16(env, jtext));
+ pasted_text = OmniboxView::SanitizeTextForPaste(pasted_text);
+ return base::android::ConvertUTF16ToJavaString(env, pasted_text).Release();
+}
+
+// static
+bool OmniboxViewUtil::RegisterOmniboxViewUtil(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
« no previous file with comments | « chrome/browser/ui/android/omnibox/omnibox_view_util.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698