1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h"
9 #include "base/logging.h"
10 #include "chrome/browser/platform_util.h"
11 #include "jni/PlatformUtil_jni.h"
12 #include "ui/android/view_android.h"
15 namespace platform_util
{
17 // TODO: crbug/115682 to track implementation of the following methods.
19 void ShowItemInFolder(Profile
* profile
, const base::FilePath
& full_path
) {
23 void OpenItem(Profile
* profile
,
24 const base::FilePath
& full_path
,
25 OpenItemType item_type
,
26 const OpenOperationCallback
& callback
) {
30 void OpenExternal(Profile
* profile
, const GURL
& url
) {
31 JNIEnv
* env
= base::android::AttachCurrentThread();
32 ScopedJavaLocalRef
<jstring
> j_url
=
33 base::android::ConvertUTF8ToJavaString(env
, url
.spec());
34 Java_PlatformUtil_launchExternalProtocol(env
, j_url
.obj());
37 gfx::NativeWindow
GetTopLevel(gfx::NativeView view
) {
39 return view
->GetWindowAndroid();
42 gfx::NativeView
GetParent(gfx::NativeView view
) {
47 bool IsWindowActive(gfx::NativeWindow window
) {
52 void ActivateWindow(gfx::NativeWindow window
) {
56 bool IsVisible(gfx::NativeView view
) {
61 bool RegisterPlatformUtil(JNIEnv
* env
) {
62 return RegisterNativesImpl(env
);
65 } // namespace platform_util