1 // Copyright 2012 The Chromium Authors
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/notreached.h"
10 #include "chrome/browser/platform_util.h"
11 #include "chrome/browser/util/jni_headers/PlatformUtil_jni.h"
12 #include "ui/android/view_android.h"
13 #include "ui/android/window_android.h"
16 using base::android::ScopedJavaLocalRef;
18 namespace platform_util {
20 // TODO: crbug/115682 to track implementation of the following methods.
22 void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) {
26 void OpenItem(Profile* profile,
27 const base::FilePath& full_path,
28 OpenItemType item_type,
29 OpenOperationCallback callback) {
33 void OpenExternal(const GURL& url) {
34 JNIEnv* env = base::android::AttachCurrentThread();
35 ScopedJavaLocalRef<jstring> j_url =
36 base::android::ConvertUTF8ToJavaString(env, url.spec());
37 Java_PlatformUtil_launchExternalProtocol(env, j_url);
40 gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
42 return view->GetWindowAndroid();
45 gfx::NativeView GetParent(gfx::NativeView view) {
50 bool IsWindowActive(gfx::NativeWindow window) {
55 void ActivateWindow(gfx::NativeWindow window) {
59 bool IsVisible(gfx::NativeView view) {
64 } // namespace platform_util