#ifndef ASH_SYSTEM_NETWORK_NETWORK_INFO_BUBBLE_H_
#define ASH_SYSTEM_NETWORK_NETWORK_INFO_BUBBLE_H_
#include <string>
#include "ash/ash_export.h"
#include "base/memory/weak_ptr.h"
#include "ui/events/event.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/widget/widget.h"
namespace ash {
class ASH_EXPORT NetworkInfoBubble : public views::BubbleDialogDelegateView {
public:
class Delegate {
public:
Delegate() = default;
virtual ~Delegate() = default;
virtual bool ShouldIncludeDeviceAddresses() = 0;
virtual void OnInfoBubbleDestroyed() = 0;
};
NetworkInfoBubble(base::WeakPtr<Delegate> delegate, views::View* anchor);
NetworkInfoBubble(const NetworkInfoBubble&) = delete;
NetworkInfoBubble& operator=(const NetworkInfoBubble&) = delete;
~NetworkInfoBubble() override;
private:
friend class NetworkInfoBubbleTest;
static constexpr int kNetworkInfoBubbleLabelViewId = 1;
gfx::Size CalculatePreferredSize() const override;
void OnMouseExited(const ui::MouseEvent& event) override;
void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params,
views::Widget* widget) const override;
std::u16string ComputeInfoText();
base::WeakPtr<Delegate> delegate_;
};
}
#endif