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 3 // found in the LICENSE file. 4 5 package org.chromium.ui.base; 6 7 import android.view.View; 8 9 /** 10 * Interface to acquire and release anchor views from the implementing View. 11 */ 12 public interface ViewAndroidDelegate { 13 14 /** 15 * @return An anchor view that can be used to anchor decoration views like Autofill popup. 16 */ 17 View acquireAnchorView(); 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. 23 * @param y Y coordinate of the top left corner of the anchor view. 24 * @param width The width of the anchor view. 25 * @param height The height of the anchor view. 26 */ 27 void setAnchorViewPosition(View view, float x, float y, float width, float height); 28 29 /** 30 * Release given anchor view. 31 * @param anchorView The anchor view that needs to be released. 32 */ 33 void releaseAnchorView(View anchorView); 34 } 35