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_THEME_INSTALL_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_THEME_INSTALL_BUBBLE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_THEME_INSTALL_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_THEME_INSTALL_BUBBLE_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "chrome/common/notification_observer.h" | 10 #include "chrome/common/notification_observer.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // may be unresponsive while the theme is being installed. | 27 // may be unresponsive while the theme is being installed. |
28 // | 28 // |
29 // Edge case: note that if one installs a theme in one window and then switches | 29 // Edge case: note that if one installs a theme in one window and then switches |
30 // rapidly to another window to install a theme there as well (in the short time | 30 // rapidly to another window to install a theme there as well (in the short time |
31 // between install begin and theme caching seizing the UI thread), the loading | 31 // between install begin and theme caching seizing the UI thread), the loading |
32 // bubble will only appear over the first window, as there is only ever one | 32 // bubble will only appear over the first window, as there is only ever one |
33 // instance of the bubble. | 33 // instance of the bubble. |
34 class ThemeInstallBubbleView : public NotificationObserver, | 34 class ThemeInstallBubbleView : public NotificationObserver, |
35 public views::Label { | 35 public views::Label { |
36 public: | 36 public: |
37 ~ThemeInstallBubbleView(); | 37 virtual ~ThemeInstallBubbleView(); |
38 | 38 |
39 // NotificationObserver | 39 // NotificationObserver |
40 virtual void Observe(NotificationType type, | 40 virtual void Observe(NotificationType type, |
41 const NotificationSource& source, | 41 const NotificationSource& source, |
42 const NotificationDetails& details); | 42 const NotificationDetails& details); |
43 | 43 |
44 // Show the loading bubble. | 44 // Show the loading bubble. |
45 static void Show(TabContents* tab_contents); | 45 static void Show(TabContents* tab_contents); |
46 | 46 |
47 private: | 47 private: |
48 explicit ThemeInstallBubbleView(TabContents* tab_contents); | 48 explicit ThemeInstallBubbleView(TabContents* tab_contents); |
49 | 49 |
50 // Put the popup in the correct place on the tab. | 50 // Put the popup in the correct place on the tab. |
51 void Reposition(); | 51 void Reposition(); |
52 | 52 |
53 // Inherited from views. | 53 // Inherited from views. |
54 gfx::Size GetPreferredSize(); | 54 virtual gfx::Size GetPreferredSize(); |
55 | 55 |
56 // Shut down the popup and remove our notifications. | 56 // Shut down the popup and remove our notifications. |
57 void Close(); | 57 void Close(); |
58 | 58 |
59 virtual void OnPaint(gfx::Canvas* canvas); | 59 virtual void OnPaint(gfx::Canvas* canvas); |
60 | 60 |
61 // The content area at the start of the animation. | 61 // The content area at the start of the animation. |
62 gfx::Rect tab_contents_bounds_; | 62 gfx::Rect tab_contents_bounds_; |
63 | 63 |
64 // Widget containing us. | 64 // Widget containing us. |
65 views::Widget* popup_; | 65 views::Widget* popup_; |
66 | 66 |
67 // Text to show warning that theme is being installed. | 67 // Text to show warning that theme is being installed. |
68 string16 text_; | 68 string16 text_; |
69 | 69 |
70 // A scoped container for notification registries. | 70 // A scoped container for notification registries. |
71 NotificationRegistrar registrar_; | 71 NotificationRegistrar registrar_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(ThemeInstallBubbleView); | 73 DISALLOW_COPY_AND_ASSIGN(ThemeInstallBubbleView); |
74 }; | 74 }; |
75 | 75 |
76 #endif // CHROME_BROWSER_UI_VIEWS_THEME_INSTALL_BUBBLE_VIEW_H_ | 76 #endif // CHROME_BROWSER_UI_VIEWS_THEME_INSTALL_BUBBLE_VIEW_H_ |
OLD | NEW |