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