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/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"
15 using base::android::ScopedJavaLocalRef;
17 namespace platform_util {
19 // TODO: crbug/115682 to track implementation of the following methods.
21 void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) {
25 void OpenItem(Profile* profile,
26 const base::FilePath& full_path,
27 OpenItemType item_type,
28 const OpenOperationCallback& callback) {
32 void OpenExternal(Profile* profile, const GURL& url) {
33 JNIEnv* env = base::android::AttachCurrentThread();
34 ScopedJavaLocalRef<jstring> j_url =
35 base::android::ConvertUTF8ToJavaString(env, url.spec());
36 Java_PlatformUtil_launchExternalProtocol(env, j_url);
39 gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
41 return view->GetWindowAndroid();
44 gfx::NativeView GetParent(gfx::NativeView view) {
49 bool IsWindowActive(gfx::NativeWindow window) {
54 void ActivateWindow(gfx::NativeWindow window) {
58 bool IsVisible(gfx::NativeView view) {
63 } // namespace platform_util