OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_GTK_EXTENSIONS_BUNDLE_INSTALLED_BUBBLE_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_EXTENSIONS_BUNDLE_INSTALLED_BUBBLE_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_EXTENSIONS_BUNDLE_INSTALLED_BUBBLE_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_EXTENSIONS_BUNDLE_INSTALLED_BUBBLE_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chrome/browser/extensions/bundle_installer.h" | 11 #include "chrome/browser/extensions/bundle_installer.h" |
12 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" | 12 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
13 #include "chrome/browser/ui/gtk/custom_button.h" | 13 #include "chrome/browser/ui/gtk/custom_button.h" |
14 | 14 |
15 class Browser; | 15 class Browser; |
16 | 16 |
17 // The GTK implementation of the bundle installed bubble. The bubble reports | 17 // The GTK implementation of the bundle installed bubble. The bubble reports |
18 // which extensions and apps installed or failed when the bundle install | 18 // which extensions and apps installed or failed when the bundle install |
19 // completes. | 19 // completes. |
20 class BundleInstalledBubbleGtk | 20 class BundleInstalledBubbleGtk |
21 : public BubbleDelegateGtk, | 21 : public BubbleDelegateGtk, |
22 public base::RefCounted<BundleInstalledBubbleGtk> { | 22 public base::RefCounted<BundleInstalledBubbleGtk> { |
23 public: | 23 public: |
24 // Displays an installed bubble in the |browser| for the |bundle|. | 24 // Displays an installed bubble in the |browser| for the |bundle|. |
25 BundleInstalledBubbleGtk(const extensions::BundleInstaller* bundle, | 25 BundleInstalledBubbleGtk(const extensions::BundleInstaller* bundle, |
26 Browser* browser); | 26 Browser* browser); |
27 virtual ~BundleInstalledBubbleGtk(); | |
28 | 27 |
29 private: | 28 private: |
30 friend class base::RefCounted<BundleInstalledBubbleGtk>; | 29 friend class base::RefCounted<BundleInstalledBubbleGtk>; |
31 | 30 |
| 31 virtual ~BundleInstalledBubbleGtk(); |
| 32 |
32 // Assembles the content area of the bubble. | 33 // Assembles the content area of the bubble. |
33 void ShowInternal(const extensions::BundleInstaller* bundle); | 34 void ShowInternal(const extensions::BundleInstaller* bundle); |
34 | 35 |
35 // The bubble lists the items that installed successfully and those that | 36 // The bubble lists the items that installed successfully and those that |
36 // failed. This assembles the lists for items in the given |state|. | 37 // failed. This assembles the lists for items in the given |state|. |
37 void InsertExtensionList(GtkWidget* parent, | 38 void InsertExtensionList(GtkWidget* parent, |
38 const extensions::BundleInstaller* bundle, | 39 const extensions::BundleInstaller* bundle, |
39 extensions::BundleInstaller::Item::State state); | 40 extensions::BundleInstaller::Item::State state); |
40 | 41 |
41 // BubbleDelegateGtk, called when the bubble is about to close. | 42 // BubbleDelegateGtk, called when the bubble is about to close. |
42 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; | 43 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; |
43 | 44 |
44 // Closes the bubble. | 45 // Closes the bubble. |
45 void Close(); | 46 void Close(); |
46 | 47 |
47 // Called when the user clicks the bubble's close button. | 48 // Called when the user clicks the bubble's close button. |
48 static void OnButtonClick(GtkWidget* button, | 49 static void OnButtonClick(GtkWidget* button, |
49 BundleInstalledBubbleGtk* bubble); | 50 BundleInstalledBubbleGtk* bubble); |
50 | 51 |
51 Browser* browser_; | 52 Browser* browser_; |
52 scoped_ptr<CustomDrawButton> close_button_; | 53 scoped_ptr<CustomDrawButton> close_button_; |
53 BubbleGtk* bubble_; | 54 BubbleGtk* bubble_; |
54 | 55 |
55 DISALLOW_COPY_AND_ASSIGN(BundleInstalledBubbleGtk); | 56 DISALLOW_COPY_AND_ASSIGN(BundleInstalledBubbleGtk); |
56 }; | 57 }; |
57 | 58 |
58 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_BUNDLE_INSTALLED_BUBBLE_GTK_H_ | 59 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_BUNDLE_INSTALLED_BUBBLE_GTK_H_ |
OLD | NEW |