Chromium Code Reviews| 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/mac_util.h" | 9 #include "base/mac/mac_util.h" |
| 10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 origin.x -= NSWidth([window frame]) - offsets.width; | 246 origin.x -= NSWidth([window frame]) - offsets.width; |
| 247 } else { | 247 } else { |
| 248 origin.x -= offsets.width; | 248 origin.x -= offsets.width; |
| 249 } | 249 } |
| 250 break; | 250 break; |
| 251 } | 251 } |
| 252 | 252 |
| 253 case info_bubble::kAlignEdgeToAnchorEdge: | 253 case info_bubble::kAlignEdgeToAnchorEdge: |
| 254 // If the arrow is to the right then move the origin so that the right | 254 // If the arrow is to the right then move the origin so that the right |
| 255 // edge aligns with the anchor. If the arrow is to the left then there's | 255 // edge aligns with the anchor. If the arrow is to the left then there's |
| 256 // nothing to do becaues the left edge is already aligned with the left | 256 // nothing to do because the left edge is already aligned with the left |
| 257 // edge of the anchor. | 257 // edge of the anchor. |
| 258 if ([bubble_ arrowLocation] == info_bubble::kTopRight) { | 258 if ([bubble_ arrowLocation] == info_bubble::kTopRight) { |
| 259 origin.x -= NSWidth([window frame]); | 259 origin.x -= NSWidth([window frame]); |
| 260 } | 260 } |
| 261 break; | 261 break; |
| 262 | 262 |
| 263 case info_bubble::kAlignRightEdgeToAnchorEdge: | |
| 264 // Account for the 1 pixel borders. | |
|
Scott Hess - ex-Googler
2012/10/15 06:06:35
Is this a TODO, or is it descriptive of what the f
beaudoin
2012/10/15 16:42:57
Leftover. (Now taken care of upstream, similarly t
| |
| 265 origin.x -= NSWidth([window frame]); | |
| 266 break; | |
| 267 | |
| 268 case info_bubble::kAlignLeftEdgeToAnchorEdge: | |
| 269 // Nothing to do. | |
| 270 break; | |
| 271 | |
| 263 default: | 272 default: |
| 264 NOTREACHED(); | 273 NOTREACHED(); |
| 265 } | 274 } |
| 266 | 275 |
| 267 origin.y -= NSHeight([window frame]); | 276 origin.y -= NSHeight([window frame]); |
| 268 [window setFrameOrigin:origin]; | 277 [window setFrameOrigin:origin]; |
| 269 } | 278 } |
| 270 | 279 |
| 271 - (void)activateTabWithContents:(TabContents*)newContents | 280 - (void)activateTabWithContents:(TabContents*)newContents |
| 272 previousContents:(TabContents*)oldContents | 281 previousContents:(TabContents*)oldContents |
| 273 atIndex:(NSInteger)index | 282 atIndex:(NSInteger)index |
| 274 userGesture:(bool)wasUserGesture { | 283 userGesture:(bool)wasUserGesture { |
| 275 // The user switched tabs; close. | 284 // The user switched tabs; close. |
| 276 [self close]; | 285 [self close]; |
| 277 } | 286 } |
| 278 | 287 |
| 279 @end // BaseBubbleController | 288 @end // BaseBubbleController |
| OLD | NEW |