(a) Except as provided in (b) of this section, a child’s grandparent may petition the superior court for an order establishing reasonable rights of visitation between the grandparent and child if

(1) the grandparent has established or attempted to establish ongoing personal contact with the child; and
(2) visitation by the grandparent is in the child’s best interest.
(b) After a decree or final order relating to child custody is entered under Alaska Stat. § 25.20.060 or Alaska Stat. § 25.24.150 or relating to an adoption under Alaska Stat. Chapter 25.23, a grandparent may petition under this section only if

(1) the grandparent did not request the court to grant visitation rights during the pendency of proceedings under Alaska Stat. § 25.20.060, Alaska Stat. Chapter 25.23, or Alaska Stat. Chapter 25.24; or
(2) there has been a change in circumstances relating to the custodial parent or the minor child that justifies reconsideration of the grandparent’s visitation rights.
(c) When determining whether to grant rights of visitation between a grandparent and grandchild under this section, Alaska Stat. § 25.20.060, or Alaska Stat. Chapter 25.24, and when determining the terms and conditions to be attached to a right of grandparent visitation, the court shall consider whether there is a history of child abuse or domestic violence attributable to the grandparent’s son or daughter who is a parent of the grandchild.