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

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

Issue 194041: Making the focus remembering across tab switch work. (Closed)
Patch Set: Fix for conflicts 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/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "base/clipboard.h" 10 #include "base/clipboard.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 // 355 //
356 // One option would seem to be to check for a non-nil field 356 // One option would seem to be to check for a non-nil field
357 // editor, and check it's selected range against its length. 357 // editor, and check it's selected range against its length.
358 model_->StartAutocomplete(false); 358 model_->StartAutocomplete(false);
359 } 359 }
360 360
361 void AutocompleteEditViewMac::ClosePopup() { 361 void AutocompleteEditViewMac::ClosePopup() {
362 popup_view_->GetModel()->StopAutocomplete(); 362 popup_view_->GetModel()->StopAutocomplete();
363 } 363 }
364 364
365 void AutocompleteEditViewMac::SetFocus() {
366 }
367
365 void AutocompleteEditViewMac::SetText(const std::wstring& display_text) { 368 void AutocompleteEditViewMac::SetText(const std::wstring& display_text) {
366 NSString* ss = base::SysWideToNSString(display_text); 369 NSString* ss = base::SysWideToNSString(display_text);
367 NSMutableAttributedString* as = 370 NSMutableAttributedString* as =
368 [[[NSMutableAttributedString alloc] initWithString:ss] autorelease]; 371 [[[NSMutableAttributedString alloc] initWithString:ss] autorelease];
369 NSFont* font = ResourceBundle::GetSharedInstance().GetFont( 372 NSFont* font = ResourceBundle::GetSharedInstance().GetFont(
370 ResourceBundle::BaseFont).nativeFont(); 373 ResourceBundle::BaseFont).nativeFont();
371 [as addAttribute:NSFontAttributeName value:font 374 [as addAttribute:NSFontAttributeName value:font
372 range:NSMakeRange(0, [as length])]; 375 range:NSMakeRange(0, [as length])];
373 376
374 url_parse::Parsed parts; 377 url_parse::Parsed parts;
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 // prepended and ".com" appended. This calls down to 847 // prepended and ".com" appended. This calls down to
845 // AutocompleteEditModel::OnControlKeyChanged() so that it can change 848 // AutocompleteEditModel::OnControlKeyChanged() so that it can change
846 // the popup to reflect this. See autocomplete_edit.cc 849 // the popup to reflect this. See autocomplete_edit.cc
847 // OnControlKeyChanged() and OnAfterPossibleChange(). 850 // OnControlKeyChanged() and OnAfterPossibleChange().
848 - (void)control:(NSControl*)control flagsChanged:(NSEvent*)theEvent { 851 - (void)control:(NSControl*)control flagsChanged:(NSEvent*)theEvent {
849 bool controlFlag = ([theEvent modifierFlags]&NSControlKeyMask) != 0; 852 bool controlFlag = ([theEvent modifierFlags]&NSControlKeyMask) != 0;
850 edit_view_->OnControlKeyChanged(controlFlag); 853 edit_view_->OnControlKeyChanged(controlFlag);
851 } 854 }
852 855
853 @end 856 @end
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_mac.h ('k') | chrome/browser/autocomplete/autocomplete_edit_view_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698