OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_GTK_EXTENSION_INSTALLED_BUBBLE_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_EXTENSION_INSTALLED_BUBBLE_GTK_H_ |
6 #define CHROME_BROWSER_GTK_EXTENSION_INSTALLED_BUBBLE_GTK_H_ | 6 #define CHROME_BROWSER_GTK_EXTENSION_INSTALLED_BUBBLE_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "chrome/browser/gtk/custom_button.h" | 11 #include "chrome/browser/gtk/custom_button.h" |
12 #include "chrome/browser/gtk/info_bubble_gtk.h" | 12 #include "chrome/browser/gtk/info_bubble_gtk.h" |
13 #include "chrome/common/notification_observer.h" | 13 #include "chrome/common/notification_observer.h" |
14 #include "chrome/common/notification_registrar.h" | 14 #include "chrome/common/notification_registrar.h" |
15 #include "third_party/skia/include/core/SkBitmap.h" | 15 #include "third_party/skia/include/core/SkBitmap.h" |
16 | 16 |
17 class Browser; | 17 class Browser; |
18 class BrowserWindowGtk; | 18 class BrowserWindowGtk; |
19 class Extension; | 19 class Extension; |
20 class SkBitmap; | 20 class SkBitmap; |
21 | 21 |
22 // Provides feedback to the user upon successful installation of an | 22 // Provides feedback to the user upon successful installation of an |
23 // extension. Depending on the type of extension, the InfoBubble will | 23 // extension. Depending on the type of extension, the InfoBubble will |
24 // point to: | 24 // point to: |
| 25 // OMNIBOX_KEYWORD-> The omnibox. |
25 // BROWSER_ACTION -> The browserAction icon in the toolbar. | 26 // BROWSER_ACTION -> The browserAction icon in the toolbar. |
26 // PAGE_ACTION -> A preview of the page action icon in the location | 27 // PAGE_ACTION -> A preview of the page action icon in the location |
27 // bar which is shown while the InfoBubble is shown. | 28 // bar which is shown while the InfoBubble is shown. |
28 // GENERIC -> The wrench menu. This case includes page actions that | 29 // GENERIC -> The wrench menu. This case includes page actions that |
29 // don't specify a default icon. | 30 // don't specify a default icon. |
30 // | 31 // |
31 // ExtensionInstallBubble manages its own lifetime. | 32 // ExtensionInstallBubble manages its own lifetime. |
32 class ExtensionInstalledBubbleGtk | 33 class ExtensionInstalledBubbleGtk |
33 : public InfoBubbleGtkDelegate, | 34 : public InfoBubbleGtkDelegate, |
34 public NotificationObserver, | 35 public NotificationObserver, |
35 public base::RefCountedThreadSafe<ExtensionInstalledBubbleGtk> { | 36 public base::RefCountedThreadSafe<ExtensionInstalledBubbleGtk> { |
36 public: | 37 public: |
37 // The behavior and content of this InfoBubble comes in three varieties. | 38 // The behavior and content of this InfoBubble comes in three varieties. |
38 enum BubbleType { | 39 enum BubbleType { |
| 40 OMNIBOX_KEYWORD, |
39 BROWSER_ACTION, | 41 BROWSER_ACTION, |
40 PAGE_ACTION, | 42 PAGE_ACTION, |
41 GENERIC | 43 GENERIC |
42 }; | 44 }; |
43 | 45 |
44 // Creates the ExtensionInstalledBubble and schedules it to be shown once | 46 // Creates the ExtensionInstalledBubble and schedules it to be shown once |
45 // the extension has loaded. |extension| is the installed extension. |browser| | 47 // the extension has loaded. |extension| is the installed extension. |browser| |
46 // is the browser window which will host the bubble. |icon| is the install | 48 // is the browser window which will host the bubble. |icon| is the install |
47 // icon of the extension. | 49 // icon of the extension. |
48 static void Show(const Extension* extension, Browser *browser, SkBitmap icon); | 50 static void Show(const Extension* extension, Browser *browser, SkBitmap icon); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 88 |
87 // The 'x' that the user can press to hide the info bubble shelf. | 89 // The 'x' that the user can press to hide the info bubble shelf. |
88 scoped_ptr<CustomDrawButton> close_button_; | 90 scoped_ptr<CustomDrawButton> close_button_; |
89 | 91 |
90 InfoBubbleGtk* info_bubble_; | 92 InfoBubbleGtk* info_bubble_; |
91 | 93 |
92 DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubbleGtk); | 94 DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubbleGtk); |
93 }; | 95 }; |
94 | 96 |
95 #endif // CHROME_BROWSER_GTK_EXTENSION_INSTALLED_BUBBLE_GTK_H_ | 97 #endif // CHROME_BROWSER_GTK_EXTENSION_INSTALLED_BUBBLE_GTK_H_ |
OLD | NEW |