| OLD | NEW |
| 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 "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" | 5 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #import "chrome/browser/ui/cocoa/view_id_util.h" | 10 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 resizable_ = !isOverflow_; | 189 resizable_ = !isOverflow_; |
| 190 [self setNeedsDisplay:YES]; | 190 [self setNeedsDisplay:YES]; |
| 191 } | 191 } |
| 192 } | 192 } |
| 193 | 193 |
| 194 - (void)resetCursorRects { | 194 - (void)resetCursorRects { |
| 195 [self addCursorRect:grippyRect_ cursor:[self appropriateCursorForGrippy]]; | 195 [self addCursorRect:grippyRect_ cursor:[self appropriateCursorForGrippy]]; |
| 196 } | 196 } |
| 197 | 197 |
| 198 - (BOOL)acceptsFirstResponder { | 198 - (BOOL)acceptsFirstResponder { |
| 199 return YES; | 199 // The overflow container needs to receive key events to handle in-item |
| 200 // navigation. The top-level container should not become first responder, |
| 201 // allowing focus travel to proceed to the first action. |
| 202 return isOverflow_; |
| 200 } | 203 } |
| 201 | 204 |
| 202 - (void)mouseEntered:(NSEvent*)theEvent { | 205 - (void)mouseEntered:(NSEvent*)theEvent { |
| 203 [[NSNotificationCenter defaultCenter] | 206 [[NSNotificationCenter defaultCenter] |
| 204 postNotificationName:kBrowserActionsContainerMouseEntered | 207 postNotificationName:kBrowserActionsContainerMouseEntered |
| 205 object:self]; | 208 object:self]; |
| 206 } | 209 } |
| 207 | 210 |
| 208 - (void)mouseDown:(NSEvent*)theEvent { | 211 - (void)mouseDown:(NSEvent*)theEvent { |
| 209 initialDragPoint_ = [self convertPoint:[theEvent locationInWindow] | 212 initialDragPoint_ = [self convertPoint:[theEvent locationInWindow] |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 retVal = [NSCursor resizeLeftRightCursor]; | 374 retVal = [NSCursor resizeLeftRightCursor]; |
| 372 } | 375 } |
| 373 return retVal; | 376 return retVal; |
| 374 } | 377 } |
| 375 | 378 |
| 376 - (CGFloat)maxAllowedWidth { | 379 - (CGFloat)maxAllowedWidth { |
| 377 return delegate_ ? delegate_->GetMaxAllowedWidth() : CGFLOAT_MAX; | 380 return delegate_ ? delegate_->GetMaxAllowedWidth() : CGFLOAT_MAX; |
| 378 } | 381 } |
| 379 | 382 |
| 380 @end | 383 @end |
| OLD | NEW |