Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: chrome/browser/ui/cocoa/theme_install_bubble_view.mm

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/common/notification_service.h" 10 #include "content/common/notification_service.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 DCHECK(window); 55 DCHECK(window);
56 56
57 NSView* parent_view = [window contentView]; 57 NSView* parent_view = [window contentView];
58 NSRect parent_bounds = [parent_view bounds]; 58 NSRect parent_bounds = [parent_view bounds];
59 if (parent_bounds.size.height < [cocoa_view_ preferredSize].height) 59 if (parent_bounds.size.height < [cocoa_view_ preferredSize].height)
60 Close(); 60 Close();
61 61
62 // Close when theme has been installed. 62 // Close when theme has been installed.
63 registrar_.Add( 63 registrar_.Add(
64 this, 64 this,
65 NotificationType::BROWSER_THEME_CHANGED, 65 chrome::BROWSER_THEME_CHANGED,
66 NotificationService::AllSources()); 66 NotificationService::AllSources());
67 67
68 // Close when we are installing an extension, not a theme. 68 // Close when we are installing an extension, not a theme.
69 registrar_.Add( 69 registrar_.Add(
70 this, 70 this,
71 NotificationType::NO_THEME_DETECTED, 71 chrome::NO_THEME_DETECTED,
72 NotificationService::AllSources()); 72 NotificationService::AllSources());
73 registrar_.Add( 73 registrar_.Add(
74 this, 74 this,
75 NotificationType::EXTENSION_INSTALLED, 75 chrome::EXTENSION_INSTALLED,
76 NotificationService::AllSources()); 76 NotificationService::AllSources());
77 registrar_.Add( 77 registrar_.Add(
78 this, 78 this,
79 NotificationType::EXTENSION_INSTALL_ERROR, 79 chrome::EXTENSION_INSTALL_ERROR,
80 NotificationService::AllSources()); 80 NotificationService::AllSources());
81 81
82 // Don't let the bubble overlap the confirm dialog. 82 // Don't let the bubble overlap the confirm dialog.
83 registrar_.Add( 83 registrar_.Add(
84 this, 84 this,
85 NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG, 85 chrome::EXTENSION_WILL_SHOW_CONFIRM_DIALOG,
86 NotificationService::AllSources()); 86 NotificationService::AllSources());
87 87
88 // Add the view. 88 // Add the view.
89 [cocoa_view_ setFrame:parent_bounds]; 89 [cocoa_view_ setFrame:parent_bounds];
90 [cocoa_view_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; 90 [cocoa_view_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
91 [parent_view addSubview:cocoa_view_ 91 [parent_view addSubview:cocoa_view_
92 positioned:NSWindowAbove 92 positioned:NSWindowAbove
93 relativeTo:nil]; 93 relativeTo:nil];
94 [cocoa_view_ layout]; 94 [cocoa_view_ layout];
95 } 95 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 [[[NSColor blackColor] colorWithAlphaComponent:kBubbleAlpha] set]; 179 [[[NSColor blackColor] colorWithAlphaComponent:kBubbleAlpha] set];
180 [[NSBezierPath bezierPathWithRoundedRect:grayRect_ 180 [[NSBezierPath bezierPathWithRoundedRect:grayRect_
181 xRadius:kBubbleCornerRadius 181 xRadius:kBubbleCornerRadius
182 yRadius:kBubbleCornerRadius] fill]; 182 yRadius:kBubbleCornerRadius] fill];
183 183
184 [message_.get() drawInRect:textRect_]; 184 [message_.get() drawInRect:textRect_];
185 } 185 }
186 186
187 @end 187 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698