OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #import "chrome/browser/cocoa/blocked_popup_container_controller.h" | 5 #import "chrome/browser/cocoa/blocked_popup_container_controller.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "chrome/browser/cocoa/nsimage_cache.h" | 9 #include "chrome/browser/cocoa/nsimage_cache.h" |
10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // If we don't add this, no title will ever display. | 94 // If we don't add this, no title will ever display. |
95 [popupButton_ addItemWithTitle:@"placeholder"]; | 95 [popupButton_ addItemWithTitle:@"placeholder"]; |
96 [view_ addSubview:popupButton_]; | 96 [view_ addSubview:popupButton_]; |
97 | 97 |
98 // Register for notifications that the menu is about to display so we can | 98 // Register for notifications that the menu is about to display so we can |
99 // fill it in lazily | 99 // fill it in lazily |
100 [[NSNotificationCenter defaultCenter] | 100 [[NSNotificationCenter defaultCenter] |
101 addObserver:self | 101 addObserver:self |
102 selector:@selector(showMenu:) | 102 selector:@selector(showMenu:) |
103 name:NSPopUpButtonCellWillPopUpNotification | 103 name:NSPopUpButtonCellWillPopUpNotification |
104 object:nil]; | 104 object:[popupButton_ cell]]; |
105 | 105 |
106 // Create the close box and position at the left of the view. | 106 // Create the close box and position at the left of the view. |
107 NSRect closeFrame = NSMakeRect(startFrame.size.width - kCloseBoxSize, | 107 NSRect closeFrame = NSMakeRect(startFrame.size.width - kCloseBoxSize, |
108 kCloseBoxPaddingY, | 108 kCloseBoxPaddingY, |
109 kCloseBoxSize, | 109 kCloseBoxSize, |
110 kCloseBoxSize); | 110 kCloseBoxSize); |
111 NSButton* close = [[[NSButton alloc] initWithFrame:closeFrame] autorelease]; | 111 NSButton* close = [[[NSButton alloc] initWithFrame:closeFrame] autorelease]; |
112 [close setAutoresizingMask:NSViewMinXMargin]; | 112 [close setAutoresizingMask:NSViewMinXMargin]; |
113 [close setImage:nsimage_cache::ImageNamed(@"close_bar.pdf")]; | 113 [close setImage:nsimage_cache::ImageNamed(@"close_bar.pdf")]; |
114 [close setAlternateImage:nsimage_cache::ImageNamed(@"close_bar_p.pdf")]; | 114 [close setAlternateImage:nsimage_cache::ImageNamed(@"close_bar_p.pdf")]; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 [controller_ update]; | 331 [controller_ update]; |
332 } | 332 } |
333 | 333 |
334 void BlockedPopupContainerViewBridge::HideView() { | 334 void BlockedPopupContainerViewBridge::HideView() { |
335 [controller_ hide]; | 335 [controller_ hide]; |
336 } | 336 } |
337 | 337 |
338 void BlockedPopupContainerViewBridge::Destroy() { | 338 void BlockedPopupContainerViewBridge::Destroy() { |
339 [controller_ autorelease]; | 339 [controller_ autorelease]; |
340 } | 340 } |
OLD | NEW |