1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26

content / public / android / java / src / org / chromium / content_public / browser / ScreenOrientationDelegate.java [blame]

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.content_public.browser;

import android.app.Activity;

/**
 * An interface for ScreenOrientationProvider to notify other components that orientation
 * preferences may change.
 */
public interface ScreenOrientationDelegate {
    /**
     * Notify the delegate that ScreenOrientationProvider consumers would like to unlock orientation
     * for an activity. Returns true if ScreenOrientationProvider should unlock orientation, and
     * false if the delegate already handled it.
     */
    boolean canUnlockOrientation(Activity activity, int defaultOrientation);

    /**
     * Allows the delegate to control whether ScreenOrientationProvider clients
     * can lock orientation.
     */
    boolean canLockOrientation();
}