platform_util_android.cc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.
  4. #include <jni.h>
  5. #include "base/android/jni_android.h"
  6. #include "base/android/jni_string.h"
  7. #include "base/notreached.h"
  8. #include "chrome/browser/platform_util.h"
  9. #include "chrome/browser/util/jni_headers/PlatformUtil_jni.h"
  10. #include "ui/android/view_android.h"
  11. #include "ui/android/window_android.h"
  12. #include "url/gurl.h"
  13. using base::android::ScopedJavaLocalRef;
  14. namespace platform_util {
  15. // TODO: crbug/115682 to track implementation of the following methods.
  16. void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) {
  17. NOTIMPLEMENTED();
  18. }
  19. void OpenItem(Profile* profile,
  20. const base::FilePath& full_path,
  21. OpenItemType item_type,
  22. OpenOperationCallback callback) {
  23. NOTIMPLEMENTED();
  24. }
  25. void OpenExternal(Profile* profile, const GURL& url) {
  26. JNIEnv* env = base::android::AttachCurrentThread();
  27. ScopedJavaLocalRef<jstring> j_url =
  28. base::android::ConvertUTF8ToJavaString(env, url.spec());
  29. Java_PlatformUtil_launchExternalProtocol(env, j_url);
  30. }
  31. gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
  32. NOTIMPLEMENTED();
  33. return view->GetWindowAndroid();
  34. }
  35. gfx::NativeView GetParent(gfx::NativeView view) {
  36. NOTIMPLEMENTED();
  37. return view;
  38. }
  39. bool IsWindowActive(gfx::NativeWindow window) {
  40. NOTIMPLEMENTED();
  41. return false;
  42. }
  43. void ActivateWindow(gfx::NativeWindow window) {
  44. NOTIMPLEMENTED();
  45. }
  46. bool IsVisible(gfx::NativeView view) {
  47. NOTIMPLEMENTED();
  48. return true;
  49. }
  50. } // namespace platform_util