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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #import "chrome/browser/ui/cocoa/theme_install_bubble_view.h" | 7 #import "chrome/browser/ui/cocoa/theme_install_bubble_view.h" |
8 | 8 |
9 #include "base/memory/scoped_nsobject.h" | 9 #include "base/memory/scoped_nsobject.h" |
10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 NSView* parent_view = [window contentView]; | 58 NSView* parent_view = [window contentView]; |
59 NSRect parent_bounds = [parent_view bounds]; | 59 NSRect parent_bounds = [parent_view bounds]; |
60 if (parent_bounds.size.height < [cocoa_view_ preferredSize].height) | 60 if (parent_bounds.size.height < [cocoa_view_ preferredSize].height) |
61 Close(); | 61 Close(); |
62 | 62 |
63 // Close when theme has been installed. | 63 // Close when theme has been installed. |
64 registrar_.Add( | 64 registrar_.Add( |
65 this, | 65 this, |
66 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 66 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
67 NotificationService::AllSources()); | 67 NotificationService::AllBrowserContextsAndSources()); |
68 | 68 |
69 // Close when we are installing an extension, not a theme. | 69 // Close when we are installing an extension, not a theme. |
70 registrar_.Add( | 70 registrar_.Add( |
71 this, | 71 this, |
72 chrome::NOTIFICATION_NO_THEME_DETECTED, | 72 chrome::NOTIFICATION_NO_THEME_DETECTED, |
73 NotificationService::AllSources()); | 73 NotificationService::AllSources()); |
74 registrar_.Add( | 74 registrar_.Add( |
75 this, | 75 this, |
76 chrome::NOTIFICATION_EXTENSION_INSTALLED, | 76 chrome::NOTIFICATION_EXTENSION_INSTALLED, |
77 NotificationService::AllSources()); | 77 NotificationService::AllSources()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 [[[NSColor blackColor] colorWithAlphaComponent:kBubbleAlpha] set]; | 180 [[[NSColor blackColor] colorWithAlphaComponent:kBubbleAlpha] set]; |
181 [[NSBezierPath bezierPathWithRoundedRect:grayRect_ | 181 [[NSBezierPath bezierPathWithRoundedRect:grayRect_ |
182 xRadius:kBubbleCornerRadius | 182 xRadius:kBubbleCornerRadius |
183 yRadius:kBubbleCornerRadius] fill]; | 183 yRadius:kBubbleCornerRadius] fill]; |
184 | 184 |
185 [message_.get() drawInRect:textRect_]; | 185 [message_.get() drawInRect:textRect_]; |
186 } | 186 } |
187 | 187 |
188 @end | 188 @end |
OLD | NEW |