Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ViewUtils.java

Issue 2777223004: Migrate IME state update flow (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/ViewUtils.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ViewUtils.java b/content/public/android/java/src/org/chromium/content/browser/ViewUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..44260621121e7c2ca56e20f4ed9a41ffca19ca0f
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/ViewUtils.java
@@ -0,0 +1,24 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser;
+
+import android.view.View;
+
+/**
+ * A utility class that has helper methods for Android view.
+ */
+public final class ViewUtils {
+ // Prevent instantiation.
+ private ViewUtils() {}
+
+ /**
+ * @return {@code true} if the given view has a focus.
+ */
+ public static boolean hasFocus(View view) {
+ // If the container view is not focusable, we consider it always focused from
+ // Chromium's point of view.
+ return !view.isFocusable() ? true : view.hasFocus();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698