1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_
8 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h"
10 #include "ui/views/bubble/bubble_delegate.h"
11 #include "ui/views/controls/button/button.h"
14 class ElevationIconSetter
;
15 class GlobalErrorWithStandardBubble
;
17 class GlobalErrorBubbleView
: public views::ButtonListener
,
18 public views::BubbleDelegateView
,
19 public GlobalErrorBubbleViewBase
{
21 GlobalErrorBubbleView(
22 views::View
* anchor_view
,
23 views::BubbleBorder::Arrow arrow
,
25 const base::WeakPtr
<GlobalErrorWithStandardBubble
>& error
);
26 ~GlobalErrorBubbleView() override
;
28 // views::ButtonListener implementation.
29 void ButtonPressed(views::Button
* sender
, const ui::Event
& event
) override
;
31 // views::WidgetDelegate implementation.
32 base::string16
GetWindowTitle() const override
;
33 gfx::ImageSkia
GetWindowIcon() override
;
34 bool ShouldShowWindowIcon() const override
;
35 void WindowClosing() override
;
37 // views::BubbleDelegateView implementation.
38 bool ShouldShowCloseButton() const override
;
40 // GlobalErrorBubbleViewBase implementation.
41 void CloseBubbleView() override
;
45 base::WeakPtr
<GlobalErrorWithStandardBubble
> error_
;
47 scoped_ptr
<ElevationIconSetter
> elevation_icon_setter_
;
49 DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubbleView
);
52 #endif // CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_