global_error_bubble_view.h revision 0f1bc08d4cfcc34181b0b5cbf065c40f687bf740
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.
4
5#ifndef CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_
6#define CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_
7
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"
12
13class Browser;
14class GlobalErrorWithStandardBubble;
15
16class GlobalErrorBubbleView : public views::ButtonListener,
17                              public views::BubbleDelegateView,
18                              public GlobalErrorBubbleViewBase {
19 public:
20  GlobalErrorBubbleView(
21      views::View* anchor_view,
22      views::BubbleBorder::Arrow arrow,
23      Browser* browser,
24      const base::WeakPtr<GlobalErrorWithStandardBubble>& error);
25  virtual ~GlobalErrorBubbleView();
26
27  // views::ButtonListener implementation.
28  virtual void ButtonPressed(views::Button* sender,
29                             const ui::Event& event) OVERRIDE;
30
31  // views::WidgetDelegate implementation.
32  virtual void WindowClosing() OVERRIDE;
33
34  // GlobalErrorBubbleViewBase implementation.
35  virtual void CloseBubbleView() OVERRIDE;
36
37 private:
38  Browser* browser_;
39  base::WeakPtr<GlobalErrorWithStandardBubble> error_;
40
41  DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubbleView);
42};
43
44#endif  // CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_
45