summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/gtk/global_error_bubble.h
blob: 3cb5b0b41eec1b243429cb1089abd82018edfca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (c) 2012 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.

#ifndef CHROME_BROWSER_UI_GTK_GLOBAL_ERROR_BUBBLE_H_
#define CHROME_BROWSER_UI_GTK_GLOBAL_ERROR_BUBBLE_H_

#include <vector>

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/global_error/global_error_bubble_view_base.h"
#include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
#include "ui/base/gtk/gtk_signal.h"

typedef struct _GtkWidget GtkWidget;

class GlobalErrorWithStandardBubble;
class Profile;

class GlobalErrorBubble : public BubbleDelegateGtk,
                          public GlobalErrorBubbleViewBase {
 public:
  GlobalErrorBubble(Browser* browser,
                    const base::WeakPtr<GlobalErrorWithStandardBubble>& error,
                    GtkWidget* anchor);
  virtual ~GlobalErrorBubble();

  // BubbleDelegateGtk implementation.
  virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE;

 private:
  CHROMEGTK_CALLBACK_0(GlobalErrorBubble, void, OnDestroy);
  CHROMEGTK_CALLBACK_0(GlobalErrorBubble, void, OnAcceptButton);
  CHROMEGTK_CALLBACK_0(GlobalErrorBubble, void, OnCancelButton);
  CHROMEGTK_CALLBACK_0(GlobalErrorBubble, void, OnRealize);

  virtual void CloseBubbleView() OVERRIDE;

  Browser* browser_;
  BubbleGtk* bubble_;
  base::WeakPtr<GlobalErrorWithStandardBubble> error_;
  std::vector<GtkWidget*> message_labels_;
  int message_width_;

  DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubble);
};

#endif  // CHROME_BROWSER_UI_GTK_GLOBAL_ERROR_BUBBLE_H_