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

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

Issue 337027: [Mac] Adjust Omnibox implementation to not break undo chain. (Closed)
Patch Set: Tweak a comment Created 11 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/cocoa/autocomplete_text_field.h » ('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) 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 color = InsecureSchemeColor(); 423 color = InsecureSchemeColor();
424 // Add a strikethrough through the scheme. 424 // Add a strikethrough through the scheme.
425 [as addAttribute:NSStrikethroughStyleAttributeName 425 [as addAttribute:NSStrikethroughStyleAttributeName
426 value:[NSNumber numberWithInt:NSUnderlineStyleSingle] 426 value:[NSNumber numberWithInt:NSUnderlineStyleSingle]
427 range:ComponentToNSRange(parts.scheme)]; 427 range:ComponentToNSRange(parts.scheme)];
428 } 428 }
429 [as addAttribute:NSForegroundColorAttributeName value:color 429 [as addAttribute:NSForegroundColorAttributeName value:color
430 range:ComponentToNSRange(parts.scheme)]; 430 range:ComponentToNSRange(parts.scheme)];
431 } 431 }
432 432
433 [field_ setObjectValue:as]; 433 [field_ setAttributedStringValue:as];
434 434
435 // TODO(shess): This may be an appropriate place to call: 435 // TODO(shess): This may be an appropriate place to call:
436 // controller_->OnChanged(); 436 // controller_->OnChanged();
437 // In the current implementation, this tells LocationBarViewMac to 437 // In the current implementation, this tells LocationBarViewMac to
438 // mess around with |model_| and update |field_|. Unfortunately, 438 // mess around with |model_| and update |field_|. Unfortunately,
439 // when I look at our peer implementations, it's not entirely clear 439 // when I look at our peer implementations, it's not entirely clear
440 // to me if this is safe. SetText() is sort of an utility method, 440 // to me if this is safe. SetText() is sort of an utility method,
441 // and different callers sometimes have different needs. Research 441 // and different callers sometimes have different needs. Research
442 // this issue so that it can be added safely. 442 // this issue so that it can be added safely.
443 443
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 // TODO(shess): Figure out where the selection belongs. On GTK, 894 // TODO(shess): Figure out where the selection belongs. On GTK,
895 // it's set to the start of the text. 895 // it's set to the start of the text.
896 } 896 }
897 897
898 // Signal that we've lost focus when the window resigns key. 898 // Signal that we've lost focus when the window resigns key.
899 - (void)windowDidResignKey:(NSNotification*)notification { 899 - (void)windowDidResignKey:(NSNotification*)notification {
900 edit_view_->OnDidResignKey(); 900 edit_view_->OnDidResignKey();
901 } 901 }
902 902
903 @end 903 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/autocomplete_text_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698