| OLD | NEW |
| 1 // Copyright (c) 2010 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/focus_tracker.h" | 5 #import "ui/base/cocoa/focus_tracker.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 | 8 |
| 9 @implementation FocusTracker | 9 @implementation FocusTracker |
| 10 | 10 |
| 11 - (id)initWithWindow:(NSWindow*)window { | 11 - (id)initWithWindow:(NSWindow*)window { |
| 12 if ((self = [super init])) { | 12 if ((self = [super init])) { |
| 13 NSResponder* current_focus = [window firstResponder]; | 13 NSResponder* current_focus = [window firstResponder]; |
| 14 | 14 |
| 15 // Special case NSTextViews, because they are removed from the | 15 // Special case NSTextViews, because they are removed from the |
| (...skipping 21 matching lines...) Expand all Loading... |
| 37 if (!focusedView_.get()) | 37 if (!focusedView_.get()) |
| 38 return NO; | 38 return NO; |
| 39 | 39 |
| 40 if ([focusedView_ window] && [focusedView_ window] == window) | 40 if ([focusedView_ window] && [focusedView_ window] == window) |
| 41 return [window makeFirstResponder:focusedView_.get()]; | 41 return [window makeFirstResponder:focusedView_.get()]; |
| 42 | 42 |
| 43 return NO; | 43 return NO; |
| 44 } | 44 } |
| 45 | 45 |
| 46 @end | 46 @end |
| OLD | NEW |