OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
10 #include "chrome/browser/views/info_bubble.h" | 10 #include "chrome/browser/views/info_bubble.h" |
11 #include "chrome/common/notification_observer.h" | 11 #include "chrome/common/notification_observer.h" |
12 #include "chrome/common/notification_registrar.h" | 12 #include "chrome/common/notification_registrar.h" |
13 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
14 | 14 |
15 class Browser; | 15 class Browser; |
16 class Extension; | 16 class Extension; |
17 class InstalledBubbleContent; | 17 class InstalledBubbleContent; |
18 class SkBitmap; | 18 class SkBitmap; |
19 | 19 |
20 // Provides feedback to the user upon successful installation of an | 20 // Provides feedback to the user upon successful installation of an |
21 // extension. Depending on the type of extension, the InfoBubble will | 21 // extension. Depending on the type of extension, the InfoBubble will |
22 // point to: | 22 // point to: |
| 23 // OMNIBOX_KEYWORD-> The omnibox. |
23 // BROWSER_ACTION -> The browserAction icon in the toolbar. | 24 // BROWSER_ACTION -> The browserAction icon in the toolbar. |
24 // PAGE_ACTION -> A preview of the pageAction icon in the location | 25 // PAGE_ACTION -> A preview of the pageAction icon in the location |
25 // bar which is shown while the InfoBubble is shown. | 26 // bar which is shown while the InfoBubble is shown. |
26 // GENERIC -> The wrench menu. This case includes pageActions that | 27 // GENERIC -> The wrench menu. This case includes pageActions that |
27 // don't specify a default icon. | 28 // don't specify a default icon. |
28 // | 29 // |
29 // ExtensionInstallBubble manages its own lifetime. | 30 // ExtensionInstallBubble manages its own lifetime. |
30 class ExtensionInstalledBubble | 31 class ExtensionInstalledBubble |
31 : public InfoBubbleDelegate, | 32 : public InfoBubbleDelegate, |
32 public NotificationObserver, | 33 public NotificationObserver, |
33 public base::RefCountedThreadSafe<ExtensionInstalledBubble> { | 34 public base::RefCountedThreadSafe<ExtensionInstalledBubble> { |
34 public: | 35 public: |
35 // The behavior and content of this InfoBubble comes in these varieties: | 36 // The behavior and content of this InfoBubble comes in these varieties: |
36 enum BubbleType { | 37 enum BubbleType { |
| 38 OMNIBOX_KEYWORD, |
37 BROWSER_ACTION, | 39 BROWSER_ACTION, |
38 PAGE_ACTION, | 40 PAGE_ACTION, |
39 GENERIC | 41 GENERIC |
40 }; | 42 }; |
41 | 43 |
42 // Creates the ExtensionInstalledBubble and schedules it to be shown once | 44 // Creates the ExtensionInstalledBubble and schedules it to be shown once |
43 // the extension has loaded. |extension| is the installed extension. |browser| | 45 // the extension has loaded. |extension| is the installed extension. |browser| |
44 // is the browser window which will host the bubble. |icon| is the install | 46 // is the browser window which will host the bubble. |icon| is the install |
45 // icon of the extension. | 47 // icon of the extension. |
46 static void Show(const Extension* extension, Browser *browser, SkBitmap icon); | 48 static void Show(const Extension* extension, Browser *browser, SkBitmap icon); |
(...skipping 28 matching lines...) Expand all Loading... |
75 InstalledBubbleContent* bubble_content_; | 77 InstalledBubbleContent* bubble_content_; |
76 BubbleType type_; | 78 BubbleType type_; |
77 | 79 |
78 // How many times we've deferred due to animations being in progress. | 80 // How many times we've deferred due to animations being in progress. |
79 int animation_wait_retries_; | 81 int animation_wait_retries_; |
80 | 82 |
81 DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubble); | 83 DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubble); |
82 }; | 84 }; |
83 | 85 |
84 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ | 86 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ |
OLD | NEW |