OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/cocoa/base_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 NSMaxY([parentWindow_ frame])); | 203 NSMaxY([parentWindow_ frame])); |
204 anchorOffset_.x -= anchor_.x; | 204 anchorOffset_.x -= anchor_.x; |
205 anchorOffset_.y -= anchor_.y; | 205 anchorOffset_.y -= anchor_.y; |
206 } | 206 } |
207 | 207 |
208 - (NSBox*)horizontalSeparatorWithFrame:(NSRect)frame { | 208 - (NSBox*)horizontalSeparatorWithFrame:(NSRect)frame { |
209 frame.size.height = 1.0; | 209 frame.size.height = 1.0; |
210 base::scoped_nsobject<NSBox> spacer([[NSBox alloc] initWithFrame:frame]); | 210 base::scoped_nsobject<NSBox> spacer([[NSBox alloc] initWithFrame:frame]); |
211 [spacer setBoxType:NSBoxSeparator]; | 211 [spacer setBoxType:NSBoxSeparator]; |
212 [spacer setBorderType:NSLineBorder]; | 212 [spacer setBorderType:NSLineBorder]; |
213 [spacer setAlphaValue:0.2]; | 213 [spacer setAlphaValue:0.75]; |
214 return [spacer.release() autorelease]; | 214 return [spacer.release() autorelease]; |
215 } | 215 } |
216 | 216 |
217 - (NSBox*)verticalSeparatorWithFrame:(NSRect)frame { | 217 - (NSBox*)verticalSeparatorWithFrame:(NSRect)frame { |
218 frame.size.width = 1.0; | 218 frame.size.width = 1.0; |
219 base::scoped_nsobject<NSBox> spacer([[NSBox alloc] initWithFrame:frame]); | 219 base::scoped_nsobject<NSBox> spacer([[NSBox alloc] initWithFrame:frame]); |
220 [spacer setBoxType:NSBoxSeparator]; | 220 [spacer setBoxType:NSBoxSeparator]; |
221 [spacer setBorderType:NSLineBorder]; | 221 [spacer setBorderType:NSLineBorder]; |
222 [spacer setAlphaValue:0.2]; | 222 [spacer setAlphaValue:0.75]; |
223 return [spacer.release() autorelease]; | 223 return [spacer.release() autorelease]; |
224 } | 224 } |
225 | 225 |
226 - (void)parentWindowDidResize:(NSNotification*)notification { | 226 - (void)parentWindowDidResize:(NSNotification*)notification { |
227 if (!parentWindow_) | 227 if (!parentWindow_) |
228 return; | 228 return; |
229 | 229 |
230 DCHECK_EQ(parentWindow_, [notification object]); | 230 DCHECK_EQ(parentWindow_, [notification object]); |
231 NSPoint newOrigin = NSMakePoint(NSMinX([parentWindow_ frame]), | 231 NSPoint newOrigin = NSMakePoint(NSMinX([parentWindow_ frame]), |
232 NSMaxY([parentWindow_ frame])); | 232 NSMaxY([parentWindow_ frame])); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 | 447 |
448 - (void)activateTabWithContents:(content::WebContents*)newContents | 448 - (void)activateTabWithContents:(content::WebContents*)newContents |
449 previousContents:(content::WebContents*)oldContents | 449 previousContents:(content::WebContents*)oldContents |
450 atIndex:(NSInteger)index | 450 atIndex:(NSInteger)index |
451 reason:(int)reason { | 451 reason:(int)reason { |
452 // The user switched tabs; close. | 452 // The user switched tabs; close. |
453 [self closeBubble]; | 453 [self closeBubble]; |
454 } | 454 } |
455 | 455 |
456 @end // BaseBubbleController | 456 @end // BaseBubbleController |
OLD | NEW |