blob: 49717d2a9b521f1262fa1ae7932b111e888a882a [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 "base/macros.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/message_center/message_center_export.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/view.h"
namespace ui {
class Event;
namespace views {
class Button;
namespace message_center {
class MessageView;
class PaddedButton;
class MESSAGE_CENTER_EXPORT NotificationControlButtonsView
: public views::View,
public views::ButtonListener {
// String to be returned by GetClassName() method.
static const char kViewClassName[];
explicit NotificationControlButtonsView(MessageView* message_view);
~NotificationControlButtonsView() override;
// Change the visibility of the close button. True to show, false to hide.
void ShowCloseButton(bool show);
// Change the visibility of the settings button. True to show, false to hide.
void ShowSettingsButton(bool show);
// Change the visibility of the settings button. True to show, false to hide.
// Default: hidden.
void ShowSnoozeButton(bool show);
// Change the visibility of all buttons. True to show, false to hide.
void ShowButtons(bool show);
// Return the focus status of any button. True if the focus is on any button,
// false otherwise.
bool IsAnyButtonFocused() const;
// Methods for retrieving the control buttons directly.
views::Button* close_button() const;
views::Button* settings_button() const;
views::Button* snooze_button() const;
// views::View
const char* GetClassName() const override;
// views::ButtonListener
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
MessageView* message_view_;
std::unique_ptr<PaddedButton> close_button_;
std::unique_ptr<PaddedButton> settings_button_;
std::unique_ptr<PaddedButton> snooze_button_;
} // namespace message_center