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

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

Issue 24449007: [Android] Allow text handles to observe position of "parent" view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address tedchoc's comments Created 7 years, 2 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/PositionObserver.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/PositionObserver.java b/content/public/android/java/src/org/chromium/content/browser/PositionObserver.java
new file mode 100644
index 0000000000000000000000000000000000000000..64b07f6612e66e8239f7507fe4b0fb0383dd7e50
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/PositionObserver.java
@@ -0,0 +1,37 @@
+// Copyright 2013 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;
+
+/**
+ * Used to register listeners that can be notified of changes to the position of a view.
+ */
+public interface PositionObserver {
+ public interface Listener {
+ /**
+ * Called during predraw if the position of the underlying view has changed.
+ */
+ public void onPositionChanged(int positionX, int positionY);
Ted C 2013/10/14 23:46:44 as a small nit, public isn't needed on any methods
+ }
+
+ /**
+ * @return The current x position of the observed view.
+ */
+ public int getPositionX();
+
+ /**
+ * @return The current y position of the observed view.
+ */
+ public int getPositionY();
+
+ /**
+ * Register a listener to be called when the position of the underlying view changes.
+ */
+ public void addListener(Listener listener);
+
+ /**
+ * Remove a previously installed listener.
+ */
+ public void removeListener(Listener listener);
+}

Powered by Google App Engine
This is Rietveld 408576698