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 #include "app/gfx/font.h" | 8 #include "app/gfx/font.h" |
9 #include "app/l10n_util_mac.h" | 9 #include "app/l10n_util_mac.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 | 855 |
856 - (BOOL)control:(NSControl*)control textShouldEndEditing:(NSText*)fieldEditor { | 856 - (BOOL)control:(NSControl*)control textShouldEndEditing:(NSText*)fieldEditor { |
857 edit_view_->OnDidEndEditing(); | 857 edit_view_->OnDidEndEditing(); |
858 | 858 |
859 return YES; | 859 return YES; |
860 | 860 |
861 // TODO(shess): Figure out where the selection belongs. On GTK, | 861 // TODO(shess): Figure out where the selection belongs. On GTK, |
862 // it's set to the start of the text. | 862 // it's set to the start of the text. |
863 } | 863 } |
864 | 864 |
865 - (NSString*)control:(NSControl*)control | |
866 textPasteActionString:(NSText*)fieldEditor { | |
867 if (!edit_view_->CanPasteAndGo()) | |
868 return nil; | |
869 | |
870 return l10n_util::GetNSStringWithFixup(edit_view_->GetPasteActionStringId()); | |
871 } | |
872 | |
873 - (void)control:(NSControl*)control textDidPasteAndGo:(NSText*)fieldEditor { | |
874 edit_view_->OnPasteAndGo(); | |
875 } | |
876 | |
877 // Signal that we've lost focus when the window resigns key. | 865 // Signal that we've lost focus when the window resigns key. |
878 - (void)windowDidResignKey:(NSNotification*)notification { | 866 - (void)windowDidResignKey:(NSNotification*)notification { |
879 edit_view_->OnDidResignKey(); | 867 edit_view_->OnDidResignKey(); |
880 } | 868 } |
881 | 869 |
882 @end | 870 @end |
OLD | NEW |