Chromium Code Reviews| 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 #import "chrome/browser/cocoa/content_blocked_bubble_controller.h" | 5 #import "chrome/browser/cocoa/content_blocked_bubble_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; | 112 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
| 113 [center addObserver:self | 113 [center addObserver:self |
| 114 selector:@selector(parentWindowWillClose:) | 114 selector:@selector(parentWindowWillClose:) |
| 115 name:NSWindowWillCloseNotification | 115 name:NSWindowWillCloseNotification |
| 116 object:parentWindow_]; | 116 object:parentWindow_]; |
| 117 } | 117 } |
| 118 return self; | 118 return self; |
| 119 } | 119 } |
| 120 | 120 |
| 121 - (void)initializeTitle { | 121 - (void)initializeTitle { |
| 122 if (!titleLabel_) | |
| 123 return; // Make valgrind happy for now. | |
|
viettrungluu
2010/03/26 20:50:18
Bug #?
Nico
2010/03/26 20:54:10
N/A. This will go away later today when I implemen
| |
| 124 | |
| 122 // Layout title post-localization. | 125 // Layout title post-localization. |
| 123 CGFloat titleDeltaY = [GTMUILocalizerAndLayoutTweaker | 126 CGFloat titleDeltaY = [GTMUILocalizerAndLayoutTweaker |
| 124 sizeToFitFixedWidthTextField:titleLabel_]; | 127 sizeToFitFixedWidthTextField:titleLabel_]; |
| 125 NSRect windowFrame = [[self window] frame]; | 128 NSRect windowFrame = [[self window] frame]; |
| 126 windowFrame.size.height += titleDeltaY; | 129 windowFrame.size.height += titleDeltaY; |
| 127 [[self window] setFrame:windowFrame display:NO]; | 130 [[self window] setFrame:windowFrame display:NO]; |
| 128 NSRect titleFrame = [titleLabel_ frame]; | 131 NSRect titleFrame = [titleLabel_ frame]; |
| 129 titleFrame.origin.y -= titleDeltaY; | 132 titleFrame.origin.y -= titleDeltaY; |
| 130 [titleLabel_ setFrame:titleFrame]; | 133 [titleLabel_ setFrame:titleFrame]; |
| 131 } | 134 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 contentSettingBubbleModel_->OnManageLinkClicked(); | 347 contentSettingBubbleModel_->OnManageLinkClicked(); |
| 345 } | 348 } |
| 346 | 349 |
| 347 - (void)popupLinkClicked:(id)sender { | 350 - (void)popupLinkClicked:(id)sender { |
| 348 content_blocked_bubble::PopupLinks::iterator i(popupLinks_.find(sender)); | 351 content_blocked_bubble::PopupLinks::iterator i(popupLinks_.find(sender)); |
| 349 DCHECK(i != popupLinks_.end()); | 352 DCHECK(i != popupLinks_.end()); |
| 350 contentSettingBubbleModel_->OnPopupClicked(i->second); | 353 contentSettingBubbleModel_->OnPopupClicked(i->second); |
| 351 } | 354 } |
| 352 | 355 |
| 353 @end // ContentBlockedBubbleController | 356 @end // ContentBlockedBubbleController |
| OLD | NEW |