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

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

Issue 2835007: Revert 49984 - patch from issue 2762014 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « base/scoped_nsobject.h ('k') | chrome/browser/autofill/autofill_text_field_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/clipboard/scoped_clipboard_writer.h" 10 #include "app/clipboard/scoped_clipboard_writer.h"
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 model_->OnControlKeyChanged(pressed); 871 model_->OnControlKeyChanged(pressed);
872 } 872 }
873 873
874 void AutocompleteEditViewMac::FocusLocation(bool select_all) { 874 void AutocompleteEditViewMac::FocusLocation(bool select_all) {
875 if ([field_ isEditable]) { 875 if ([field_ isEditable]) {
876 // If the text field has a field editor, it's the first responder, meaning 876 // If the text field has a field editor, it's the first responder, meaning
877 // that it's already focused. makeFirstResponder: will select all, so only 877 // that it's already focused. makeFirstResponder: will select all, so only
878 // call it if this behavior is desired. 878 // call it if this behavior is desired.
879 if (select_all || ![field_ currentEditor]) 879 if (select_all || ![field_ currentEditor])
880 [[field_ window] makeFirstResponder:field_]; 880 [[field_ window] makeFirstResponder:field_];
881 // FIXME 881 DCHECK_EQ([field_ currentEditor], [[field_ window] firstResponder]);
882 DCHECK_EQ((id)[field_ currentEditor], (id)[[field_ window] firstResponder]);
883 } 882 }
884 } 883 }
885 884
886 // TODO(shess): Copied from autocomplete_edit_view_win.cc. Could this 885 // TODO(shess): Copied from autocomplete_edit_view_win.cc. Could this
887 // be pushed into the model? 886 // be pushed into the model?
888 std::wstring AutocompleteEditViewMac::GetClipboardText(Clipboard* clipboard) { 887 std::wstring AutocompleteEditViewMac::GetClipboardText(Clipboard* clipboard) {
889 // autocomplete_edit_view_win.cc assumes this can never happen, we 888 // autocomplete_edit_view_win.cc assumes this can never happen, we
890 // will too. 889 // will too.
891 DCHECK(clipboard); 890 DCHECK(clipboard);
892 891
(...skipping 30 matching lines...) Expand all
923 } 922 }
924 923
925 return std::wstring(); 924 return std::wstring();
926 } 925 }
927 926
928 // static 927 // static
929 NSFont* AutocompleteEditViewMac::GetFieldFont() { 928 NSFont* AutocompleteEditViewMac::GetFieldFont() {
930 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 929 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
931 return rb.GetFont(ResourceBundle::BaseFont).nativeFont(); 930 return rb.GetFont(ResourceBundle::BaseFont).nativeFont();
932 } 931 }
OLDNEW
« no previous file with comments | « base/scoped_nsobject.h ('k') | chrome/browser/autofill/autofill_text_field_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698