OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_VIEW_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_VIEW_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "chrome/browser/ui/extensions/extension_installed_bubble.h" | |
10 #include "ui/views/bubble/bubble_delegate.h" | |
11 | |
12 class Browser; | |
13 | |
14 namespace extensions { | |
15 class Extension; | |
16 } | |
17 | |
18 // Provides feedback to the user upon successful installation of an | |
19 // extension. Depending on the type of extension, the Bubble will | |
20 // point to: | |
21 // OMNIBOX_KEYWORD-> The omnibox. | |
22 // BROWSER_ACTION -> The browserAction icon in the toolbar. | |
23 // PAGE_ACTION -> A preview of the pageAction icon in the location | |
24 // bar which is shown while the Bubble is shown. | |
25 // GENERIC -> The wrench menu. This case includes pageActions that | |
26 // don't specify a default icon. | |
27 class ExtensionInstalledBubbleView | |
28 : public ExtensionInstalledBubble::Delegate, | |
29 public views::BubbleDelegateView { | |
30 public: | |
31 // Creates the ExtensionInstalledBubbleView and schedules it to be shown once | |
32 // the extension has loaded. |extension| is the installed extension. |browser| | |
33 // is the browser window which will host the bubble. |icon| is the install | |
34 // icon of the extension. | |
35 static void Show(const extensions::Extension* extension, | |
36 Browser *browser, | |
tfarina
2013/09/03 19:51:27
nit: Browser*
Yoyo Zhou
2013/09/03 22:15:55
Done.
| |
37 const SkBitmap& icon); | |
38 | |
39 private: | |
40 ExtensionInstalledBubbleView(const extensions::Extension* extension, | |
41 Browser *browser, | |
42 const SkBitmap& icon); | |
43 | |
44 virtual ~ExtensionInstalledBubbleView(); | |
45 | |
46 // ExtensionInstalledBubble::Delegate | |
47 virtual void ShowInternal() OVERRIDE; | |
48 virtual void OnBrowserClosing() OVERRIDE; | |
49 | |
50 // views::WidgetDelegate | |
tfarina
2013/09/03 19:51:27
views::WidgetDelegate:
Yoyo Zhou
2013/09/03 22:15:55
Done.
| |
51 virtual void WindowClosing() OVERRIDE; | |
52 | |
53 // views::BubbleDelegate | |
54 virtual gfx::Rect GetAnchorRect() OVERRIDE; | |
55 | |
56 ExtensionInstalledBubble bubble_; | |
tfarina
2013/09/03 19:51:27
Scott prefers like this, on the stack. But I'd use
Yoyo Zhou
2013/09/03 22:15:55
In that case I'll leave it as is.
| |
57 | |
58 DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubbleView); | |
59 }; | |
60 | |
61 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_VIEW_H_ | |
OLD | NEW |