OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" |
6 | 6 |
7 #include <Carbon/Carbon.h> // kVK_Return | 7 #include <Carbon/Carbon.h> // kVK_Return |
8 | 8 |
9 #include "app/clipboard/clipboard.h" | 9 #include "app/clipboard/clipboard.h" |
10 #include "app/gfx/font.h" | 10 #include "app/gfx/font.h" |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 EmphasizeURLComponents(); | 544 EmphasizeURLComponents(); |
545 controller_->OnChanged(); | 545 controller_->OnChanged(); |
546 | 546 |
547 return something_changed; | 547 return something_changed; |
548 } | 548 } |
549 | 549 |
550 gfx::NativeView AutocompleteEditViewMac::GetNativeView() const { | 550 gfx::NativeView AutocompleteEditViewMac::GetNativeView() const { |
551 return field_; | 551 return field_; |
552 } | 552 } |
553 | 553 |
554 gfx::NativeView AutocompleteEditViewMac::GetFocusNativeView() const { | |
555 return field_; | |
556 } | |
557 | |
558 void AutocompleteEditViewMac::OnUpOrDownKeyPressed(bool up, bool by_page) { | 554 void AutocompleteEditViewMac::OnUpOrDownKeyPressed(bool up, bool by_page) { |
559 // We should only arrive here when the field is focussed. | 555 // We should only arrive here when the field is focussed. |
560 DCHECK(IsFirstResponder()); | 556 DCHECK(IsFirstResponder()); |
561 | 557 |
562 const int count = by_page ? model_->result().size() : 1; | 558 const int count = by_page ? model_->result().size() : 1; |
563 model_->OnUpOrDownKeyPressed(up ? -count : count); | 559 model_->OnUpOrDownKeyPressed(up ? -count : count); |
564 } | 560 } |
565 | 561 |
566 void AutocompleteEditViewMac::OnEscapeKeyPressed() { | 562 void AutocompleteEditViewMac::OnEscapeKeyPressed() { |
567 // We should only arrive here when the field is focussed. | 563 // We should only arrive here when the field is focussed. |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 // TODO(shess): Figure out where the selection belongs. On GTK, | 866 // TODO(shess): Figure out where the selection belongs. On GTK, |
871 // it's set to the start of the text. | 867 // it's set to the start of the text. |
872 } | 868 } |
873 | 869 |
874 // Signal that we've lost focus when the window resigns key. | 870 // Signal that we've lost focus when the window resigns key. |
875 - (void)windowDidResignKey:(NSNotification*)notification { | 871 - (void)windowDidResignKey:(NSNotification*)notification { |
876 edit_view_->OnDidResignKey(); | 872 edit_view_->OnDidResignKey(); |
877 } | 873 } |
878 | 874 |
879 @end | 875 @end |
OLD | NEW |