Home | History | Annotate | Download | only in gtk
      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_GTK_GLOBAL_ERROR_BUBBLE_H_
      6 #define CHROME_BROWSER_UI_GTK_GLOBAL_ERROR_BUBBLE_H_
      7 
      8 #include <vector>
      9 
     10 #include "base/basictypes.h"
     11 #include "base/compiler_specific.h"
     12 #include "base/memory/weak_ptr.h"
     13 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h"
     14 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
     15 #include "ui/base/gtk/gtk_signal.h"
     16 
     17 typedef struct _GtkWidget GtkWidget;
     18 
     19 class GlobalError;
     20 class Profile;
     21 
     22 class GlobalErrorBubble : public BubbleDelegateGtk,
     23                           public GlobalErrorBubbleViewBase {
     24  public:
     25   GlobalErrorBubble(Browser* browser,
     26                     const base::WeakPtr<GlobalError>& error,
     27                     GtkWidget* anchor);
     28   virtual ~GlobalErrorBubble();
     29 
     30   // BubbleDelegateGtk implementation.
     31   virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE;
     32 
     33  private:
     34   CHROMEGTK_CALLBACK_0(GlobalErrorBubble, void, OnDestroy);
     35   CHROMEGTK_CALLBACK_0(GlobalErrorBubble, void, OnAcceptButton);
     36   CHROMEGTK_CALLBACK_0(GlobalErrorBubble, void, OnCancelButton);
     37   CHROMEGTK_CALLBACK_0(GlobalErrorBubble, void, OnRealize);
     38 
     39   virtual void CloseBubbleView() OVERRIDE;
     40 
     41   Browser* browser_;
     42   BubbleGtk* bubble_;
     43   base::WeakPtr<GlobalError> error_;
     44   std::vector<GtkWidget*> message_labels_;
     45   int message_width_;
     46 
     47   DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubble);
     48 };
     49 
     50 #endif  // CHROME_BROWSER_UI_GTK_GLOBAL_ERROR_BUBBLE_H_
     51