Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm

Issue 207047: [Mac] Convert Omnibox paste-and-go to use AutocompleteTextFieldObserver. (Closed)
Patch Set: Oops - remove test before its time. Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_mac.h ('k') | chrome/browser/autocomplete/autocomplete_popup_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698