Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
qinmin | d4599b4 | 2015-09-08 20:06:20 | [diff] [blame] | 5 | #include <jni.h> |
6 | |||||
7 | #include "base/android/jni_android.h" | ||||
8 | #include "base/android/jni_string.h" | ||||
Hans Wennborg | 1790e6b | 2020-04-24 19:10:33 | [diff] [blame] | 9 | #include "base/notreached.h" |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 10 | #include "chrome/browser/platform_util.h" |
jaekyun | e4f9eed | 2015-02-24 02:06:58 | [diff] [blame] | 11 | #include "ui/android/view_android.h" |
Christoph Schwering | a1ea47fae | 2022-03-10 02:09:53 | [diff] [blame] | 12 | #include "ui/android/window_android.h" |
qinmin | d4599b4 | 2015-09-08 20:06:20 | [diff] [blame] | 13 | #include "url/gurl.h" |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 14 | |
Andrew Grieve | ecb885bb | 2024-05-29 18:14:19 | [diff] [blame] | 15 | // Must come after all headers that specialize FromJniType() / ToJniType(). |
16 | #include "chrome/browser/util/jni_headers/PlatformUtil_jni.h" | ||||
17 | |||||
torne | 8656011 | 2016-08-04 15:59:04 | [diff] [blame] | 18 | using base::android::ScopedJavaLocalRef; |
19 | |||||
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 20 | namespace platform_util { |
21 | |||||
22 | // TODO: crbug/115682 to track implementation of the following methods. | ||||
23 | |||||
[email protected] | 4d225de1 | 2013-12-13 09:29:17 | [diff] [blame] | 24 | void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 25 | NOTIMPLEMENTED(); |
26 | } | ||||
27 | |||||
asanka | 655d111 | 2015-03-07 05:33:41 | [diff] [blame] | 28 | void OpenItem(Profile* profile, |
29 | const base::FilePath& full_path, | ||||
30 | OpenItemType item_type, | ||||
Alexander Cooper | 71fa2b0 | 2020-07-16 17:49:36 | [diff] [blame] | 31 | OpenOperationCallback callback) { |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 32 | NOTIMPLEMENTED(); |
33 | } | ||||
34 | |||||
David Roger | d283a17 | 2022-10-06 10:01:15 | [diff] [blame] | 35 | void OpenExternal(const GURL& url) { |
qinmin | d4599b4 | 2015-09-08 20:06:20 | [diff] [blame] | 36 | JNIEnv* env = base::android::AttachCurrentThread(); |
37 | ScopedJavaLocalRef<jstring> j_url = | ||||
38 | base::android::ConvertUTF8ToJavaString(env, url.spec()); | ||||
torne | 948f366 | 2016-08-16 15:10:44 | [ |