OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_COCOA_THEME_INSTALL_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_THEME_INSTALL_BUBBLE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_COCOA_THEME_INSTALL_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_COCOA_THEME_INSTALL_BUBBLE_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/common/notification_observer.h" | 9 #include "content/common/notification_observer.h" |
10 #include "content/common/notification_registrar.h" | 10 #include "content/common/notification_registrar.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // Edge case: note that if one installs a theme in one window and then switches | 23 // Edge case: note that if one installs a theme in one window and then switches |
24 // rapidly to another window to install a theme there as well (in the short time | 24 // rapidly to another window to install a theme there as well (in the short time |
25 // between install begin and theme caching seizing the UI thread), the loading | 25 // between install begin and theme caching seizing the UI thread), the loading |
26 // bubble will only appear over the first window, as there is only ever one | 26 // bubble will only appear over the first window, as there is only ever one |
27 // instance of the bubble. | 27 // instance of the bubble. |
28 class ThemeInstallBubbleView : public NotificationObserver { | 28 class ThemeInstallBubbleView : public NotificationObserver { |
29 public: | 29 public: |
30 virtual ~ThemeInstallBubbleView(); | 30 virtual ~ThemeInstallBubbleView(); |
31 | 31 |
32 // NotificationObserver | 32 // NotificationObserver |
33 virtual void Observe(NotificationType type, | 33 virtual void Observe(int type, |
34 const NotificationSource& source, | 34 const NotificationSource& source, |
35 const NotificationDetails& details); | 35 const NotificationDetails& details); |
36 | 36 |
37 // Show the loading bubble. | 37 // Show the loading bubble. |
38 static void Show(NSWindow* window); | 38 static void Show(NSWindow* window); |
39 | 39 |
40 private: | 40 private: |
41 explicit ThemeInstallBubbleView(NSWindow* window); | 41 explicit ThemeInstallBubbleView(NSWindow* window); |
42 | 42 |
43 // The one copy of the loading bubble. | 43 // The one copy of the loading bubble. |
44 static ThemeInstallBubbleView* view_; | 44 static ThemeInstallBubbleView* view_; |
45 | 45 |
46 // A scoped container for notification registries. | 46 // A scoped container for notification registries. |
47 NotificationRegistrar registrar_; | 47 NotificationRegistrar registrar_; |
48 | 48 |
49 // Shut down the popup and remove our notifications. | 49 // Shut down the popup and remove our notifications. |
50 void Close(); | 50 void Close(); |
51 | 51 |
52 // The actual Cocoa view implementing the bubble. | 52 // The actual Cocoa view implementing the bubble. |
53 ThemeInstallBubbleViewCocoa* cocoa_view_; | 53 ThemeInstallBubbleViewCocoa* cocoa_view_; |
54 | 54 |
55 // Multiple loads can be started at once. Only show one bubble, and keep | 55 // Multiple loads can be started at once. Only show one bubble, and keep |
56 // track of number of loads happening. Close bubble when num_loads < 1. | 56 // track of number of loads happening. Close bubble when num_loads < 1. |
57 int num_loads_extant_; | 57 int num_loads_extant_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(ThemeInstallBubbleView); | 59 DISALLOW_COPY_AND_ASSIGN(ThemeInstallBubbleView); |
60 }; | 60 }; |
61 | 61 |
62 #endif // CHROME_BROWSER_UI_COCOA_THEME_INSTALL_BUBBLE_VIEW_H_ | 62 #endif // CHROME_BROWSER_UI_COCOA_THEME_INSTALL_BUBBLE_VIEW_H_ |
OLD | NEW |