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 | |||||
Daniel Cheng | 1ed740a | 2025-06-19 18:48:48 | [diff] [blame] | 5 | #include "chrome/browser/platform_util.h" |
6 | |||||
qinmin | d4599b4 | 2015-09-08 20:06:20 | [diff] [blame] | 7 | #include <jni.h> |
8 | |||||
9 | #include "base/android/jni_android.h" | ||||
10 | #include "base/android/jni_string.h" | ||||
Daniel Cheng | 1ed740a | 2025-06-19 18:48:48 | [diff] [blame] | 11 | #include "base/notimplemented.h" |
jaekyun | e4f9eed | 2015-02-24 02:06:58 | [diff] [blame] | 12 | #include "ui/android/view_android.h" |
Christoph Schwering | a1ea47fae | 2022-03-10 02:09:53 | [diff] [blame] | 13 | #include "ui/android/window_android.h" |
qinmin | d4599b4 | 2015-09-08 20:06:20 | [diff] [blame] | 14 | #include "url/gurl.h" |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 15 | |
Andrew Grieve | ecb885bb | 2024-05-29 18:14:19 | [diff] [blame] | 16 | // Must come after all headers that specialize FromJniType() / ToJniType(). |
17 | #include "chrome/browser/util/jni_headers/PlatformUtil_jni.h" | ||||
18 | |||||
torne | 8656011 | 2016-08-04 15:59:04 | [diff] [blame] | 19 | using base::android::ScopedJavaLocalRef; |
20 | |||||
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 21 | namespace platform_util { |
22 | |||||
23 | // TODO: crbug/115682 to track implementation of the following methods. | ||||
24 | |||||
[email protected] | 4d225de1 | 2013-12-13 09:29:17 | [diff] [blame] | 25 | void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 26 | NOTIMPLEMENTED(); |
27 | } | ||||
28 | |||||
asanka | 655d111 | 2015-03-07 05:33:41 | [diff] [blame] | 29 | void OpenItem(Profile* profile, |
30 | const base::FilePath& full_path, | ||||
31 | OpenItemType item_type, | ||||
Alexander Cooper | 71fa2b0 | 2020-07-16 17:49:36 | [diff] [blame] | 32 | OpenOperationCallback callback) { |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 33 | NOTIMPLEMENTED(); |
34 | } | ||||
35 | |||||
David Roger | d283a17 | 2022-10-06 10:01:15 | [diff] [blame] | 36 | void OpenExternal(const GURL& url) { |
qinmin | d4599b4 | 2015-09-08 20:06:20 | [diff] [blame] | 37 | JNIEnv* env = base::android::AttachCurrentThread(); |
38 | ScopedJavaLocalRef<jstring> j_url = | ||||
39 | base::android::ConvertUTF8ToJavaString(env, url.spec()); | ||||
torne | 948f366 | 2016-08-16 15:10:44 | [diff] [blame] | 40 | Java_PlatformUtil_launchExternalProtocol(env, j_url); |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 41 | } |
42 | |||||
43 | gfx::NativeWindow GetTopLevel(gfx::NativeView view) { | ||||
44 | NOTIMPLEMENTED(); | ||||
[email protected] | 2d02a200 | 2012-09-18 21:47:56 | [diff] [blame] | 45 | return view->GetWindowAndroid(); |
[email protected] | efad664 | 2012-02-28 03:42:42 | [diff] [blame] | 46 | } |
47 | |||||
48 | gfx::NativeView GetParent(gfx::NativeView view) { | ||||
49 | NOTIMPLEMENTED(); | ||||
50 | return view; | ||||
51 | } | ||||
52 | |||||
53 | bool IsWindowActive(gfx::NativeWindow window) { | ||||
54 | NOTIMPLEMENTED(); | ||||
55 | return false; | ||||
56 | } | ||||
57 | |||||
58 | void ActivateWindow(gfx::NativeWindow window) { | ||||
59 | NOTIMPLEMENTED(); | ||||
60 | } | ||||
61 | |||||
62 | bool IsVisible(gfx::NativeView view) { | ||||
63 | NOTIMPLEMENTED(); | ||||
64 | return true; | ||||
65 | } | ||||
66 | |||||
67 | } // namespace platform_util |