blob: 6a13a305d33b602bc203a8412badf95086f827a7 [file] [log] [blame]
// Copyright 2017 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.
#include "ash/ash_export.h"
#include "ash/login/ui/non_accessible_view.h"
#include "ash/shell.h"
#include "ash/tray_action/tray_action.h"
#include "ash/tray_action/tray_action_observer.h"
#include "base/macros.h"
#include "base/scoped_observer.h"
namespace ash {
namespace mojom {
enum class TrayActionState;
// View for lock sreen UI element for launching note taking action handler app.
// The element is an image button with a semi-transparent bubble background,
// which is expanded upon hovering/focusing the element.
// The bubble is a quarter of a circle with the center in top right corner of
// the view (in LTR layout).
// The button is only visible if the lock screen note taking action is available
// (the view observes the action availability using login data dispatcher, and
// updates itself accordingly).
class ASH_EXPORT NoteActionLaunchButton : public NonAccessibleView {
// Used by tests to get internal implementation details.
class ASH_EXPORT TestApi {
explicit TestApi(NoteActionLaunchButton* launch_button);
// Gets the foreground, action image button view.
const views::View* ActionButtonView() const;
// Gets the background view.
const views::View* BackgroundView() const;
NoteActionLaunchButton* launch_button_;
explicit NoteActionLaunchButton(
mojom::TrayActionState initial_note_action_state);
~NoteActionLaunchButton() override;
// Updates the bubble visibility depending on the note taking action state.
void UpdateVisibility(mojom::TrayActionState action_state);
class BackgroundView;
class ActionButton;
// The background bubble view.
BackgroundView* background_ = nullptr;
// The actionable image button view.
ActionButton* action_button_ = nullptr;
} // namespace ash