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/location_bar/autocomplete_text_field_cell.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
9 #include "base/mac/mac_logging.h" | 9 #include "base/mac/mac_logging.h" |
10 #include "chrome/browser/search/search.h" | 10 #include "chrome/browser/search/search.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 [view convertPoint:mouseLocationWindow fromView:nil]; | 540 [view convertPoint:mouseLocationWindow fromView:nil]; |
541 const BOOL mouseInRect = NSMouseInRect( | 541 const BOOL mouseInRect = NSMouseInRect( |
542 mouseLocation, decorationFrames[i], [view isFlipped]); | 542 mouseLocation, decorationFrames[i], [view isFlipped]); |
543 button->SetButtonState(mouseInRect ? | 543 button->SetButtonState(mouseInRect ? |
544 ButtonDecoration::kButtonStateHover : | 544 ButtonDecoration::kButtonStateHover : |
545 ButtonDecoration::kButtonStateNormal); | 545 ButtonDecoration::kButtonStateNormal); |
546 [view setNeedsDisplay:YES]; | 546 [view setNeedsDisplay:YES]; |
547 } | 547 } |
548 | 548 |
549 NSDictionary* info = [self getDictionaryForButtonDecoration:button]; | 549 NSDictionary* info = [self getDictionaryForButtonDecoration:button]; |
550 scoped_nsobject<CrTrackingArea> area( | 550 base::scoped_nsobject<CrTrackingArea> area( |
551 [[CrTrackingArea alloc] initWithRect:decorationFrames[i] | 551 [[CrTrackingArea alloc] initWithRect:decorationFrames[i] |
552 options:NSTrackingMouseEnteredAndExited | | 552 options:NSTrackingMouseEnteredAndExited | |
553 NSTrackingActiveAlways | 553 NSTrackingActiveAlways |
554 owner:view | 554 owner:view |
555 userInfo:info]); | 555 userInfo:info]); |
Nico
2013/06/25 01:09:50
Also http://llvm.org/PR15349.
| |
556 [view addTrackingArea:area]; | 556 [view addTrackingArea:area]; |
557 } | 557 } |
558 } | 558 } |
559 } | 559 } |
560 | 560 |
561 // Given a newly created .webloc plist url file, also give it a resource | 561 // Given a newly created .webloc plist url file, also give it a resource |
562 // fork and insert 'TEXT and 'url ' resources holding further copies of the | 562 // fork and insert 'TEXT and 'url ' resources holding further copies of the |
563 // url data. This is required for apps such as Terminal and Safari to accept it | 563 // url data. This is required for apps such as Terminal and Safari to accept it |
564 // as a real webloc file when dragged in. | 564 // as a real webloc file when dragged in. |
565 // It's expected that the resource fork requirement will go away at some | 565 // It's expected that the resource fork requirement will go away at some |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
756 NSTextView* fieldEditor = | 756 NSTextView* fieldEditor = |
757 base::mac::ObjCCastStrict<NSTextView>([controlView currentEditor]); | 757 base::mac::ObjCCastStrict<NSTextView>([controlView currentEditor]); |
758 [fieldEditor updateInsertionPointStateAndRestartTimer:YES]; | 758 [fieldEditor updateInsertionPointStateAndRestartTimer:YES]; |
759 } | 759 } |
760 | 760 |
761 - (BOOL)showsFirstResponder { | 761 - (BOOL)showsFirstResponder { |
762 return [super showsFirstResponder] && !hideFocusState_; | 762 return [super showsFirstResponder] && !hideFocusState_; |
763 } | 763 } |
764 | 764 |
765 @end | 765 @end |
OLD | NEW |