| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/dom_distiller/core/url_utils_android.h" | 5 #include "components/dom_distiller/core/url_utils_android.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "components/dom_distiller/core/url_utils.h" | 10 #include "components/dom_distiller/core/url_utils.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 return NULL; | 27 return NULL; |
| 28 } | 28 } |
| 29 GURL view_url = | 29 GURL view_url = |
| 30 dom_distiller::url_utils::GetDistillerViewUrlFromUrl(scheme, url); | 30 dom_distiller::url_utils::GetDistillerViewUrlFromUrl(scheme, url); |
| 31 if (!view_url.is_valid()) { | 31 if (!view_url.is_valid()) { |
| 32 return NULL; | 32 return NULL; |
| 33 } | 33 } |
| 34 return base::android::ConvertUTF8ToJavaString(env, view_url.spec()).Release(); | 34 return base::android::ConvertUTF8ToJavaString(env, view_url.spec()).Release(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 jboolean IsUrlReportable(JNIEnv* env, |
| 38 jclass clazz, |
| 39 jstring j_scheme, |
| 40 jstring j_url) { |
| 41 std::string scheme(base::android::ConvertJavaStringToUTF8(env, j_scheme)); |
| 42 GURL url(base::android::ConvertJavaStringToUTF8(env, j_url)); |
| 43 return dom_distiller::url_utils::IsUrlReportable(scheme, url); |
| 44 } |
| 45 |
| 37 bool RegisterUrlUtils(JNIEnv* env) { return RegisterNativesImpl(env); } | 46 bool RegisterUrlUtils(JNIEnv* env) { return RegisterNativesImpl(env); } |
| 38 | 47 |
| 39 } // namespace android | 48 } // namespace android |
| 40 | 49 |
| 41 } // namespace url_utils | 50 } // namespace url_utils |
| 42 | 51 |
| 43 } // namespace dom_distiller | 52 } // namespace dom_distiller |
| OLD | NEW |