| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.ui.base; | 5 package org.chromium.ui.base; |
| 6 | 6 |
| 7 import android.view.View; | 7 import android.view.View; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Interface to acquire and release anchor views from the implementing View. | 10 * Interface to acquire and release anchor views from the implementing View. |
| 11 */ | 11 */ |
| 12 public interface ViewAndroidDelegate { | 12 public interface ViewAndroidDelegate { |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * @return An anchor view that can be used to anchor decoration views like A
utofill popup. | 15 * Add a view used to anchor decoration views like Autofill popup, and |
| 16 */ | 16 * set the anchor view to specified position and width (all units in dp). |
| 17 View acquireAnchorView(); | 17 * @param anchorView The anchor view that needs to be positioned. |
| 18 | |
| 19 /** | |
| 20 * Set the anchor view to specified position and width (all units in dp). | |
| 21 * @param view The anchor view that needs to be positioned. | |
| 22 * @param x X coordinate of the top left corner of the anchor view. | 18 * @param x X coordinate of the top left corner of the anchor view. |
| 23 * @param y Y coordinate of the top left corner of the anchor view. | 19 * @param y Y coordinate of the top left corner of the anchor view. |
| 24 * @param width The width of the anchor view. | 20 * @param width The width of the anchor view. |
| 25 * @param height The height of the anchor view. | 21 * @param height The height of the anchor view. |
| 22 * @return A newly added view |
| 26 */ | 23 */ |
| 27 void setAnchorViewPosition(View view, float x, float y, float width, float h
eight); | 24 void addView(View anchorView, float x, float y, float width, float height); |
| 28 | 25 |
| 29 /** | 26 /** |
| 30 * Release given anchor view. | 27 * Release given anchor view. |
| 31 * @param anchorView The anchor view that needs to be released. | 28 * @param anchorView The anchor view that needs to be released. |
| 32 */ | 29 */ |
| 33 void releaseAnchorView(View anchorView); | 30 void releaseAnchorView(View anchorView); |
| 34 } | 31 } |
| OLD | NEW |