blob: 7e7896a8693666b7d405f8e393cad29c9c66d6d9 [file] [log] [blame]
// Copyright 2014 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.
// The <code>chrome.launcherPage</code> API provides launcher pages in the
// Chrome Launcher with the capabilities and events they need.
namespace launcherPage {
callback PushSubpageCallback = void();
callback ShowCallback = void();
callback HideCallback = void();
callback SetEnabledCallback = void();
interface Functions {
// Pushes a subpage state onto a state stack for the launcher page. This
// state will be popped when the launcher's back button is pressed,
// preventing the launcher from hiding the launcher page and sending an
// onPopSubpage event to the launcher page. Once all states are popped, the
// next press of the back button will cause the launcher to be hidden.
// Note: All subpages are immediately popped when the launcher is closed or
// the launcher page is otherwise hidden.
static void pushSubpage(optional PushSubpageCallback callback);
// Opens the launcher if it isn't currently open and shows the launcher
// page.
static void show(optional ShowCallback callback);
// Returns the launcher to the start page if the launcher page is showing.
static void hide(optional HideCallback callback);
// Sets whether the launcher page is enabled in the launcher. If disabled,
// the launcher page will not be shown when the area at the bottom of the
// launcher is pressed.
// Note: The launcher page will still be displayed at the bottom of the
// launcher's start page and will still show the
// launcher page.
static void setEnabled(boolean enabled,
optional SetEnabledCallback callback);
interface Events {
// Fired when the launcher page is transitioning between hidden and shown.
// It's possible for this to be called with a pushed subpage so this
// event handler should account for transitioning from any subpage to a
// collapsed view.
static void onTransitionChanged(double progress);
// Fired when the launcher's back button is pressed if there are remaining
// subpages on the state stack pushed by pushSubpage().
static void onPopSubpage();