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

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

Issue 215038: [Mac] Add a strikethrough through insecure url schemes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « no previous file | no next file » | 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 #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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 412
413 // Emphasize the scheme for security UI display purposes (if necessary). 413 // Emphasize the scheme for security UI display purposes (if necessary).
414 if (!model_->user_input_in_progress() && parts.scheme.is_nonempty() && 414 if (!model_->user_input_in_progress() && parts.scheme.is_nonempty() &&
415 (scheme_security_level != ToolbarModel::NORMAL)) { 415 (scheme_security_level != ToolbarModel::NORMAL)) {
416 NSColor* color; 416 NSColor* color;
417 if (scheme_security_level == ToolbarModel::SECURE) { 417 if (scheme_security_level == ToolbarModel::SECURE) {
418 color = SecureSchemeColor(); 418 color = SecureSchemeColor();
419 } else { 419 } else {
420 color = InsecureSchemeColor(); 420 color = InsecureSchemeColor();
421 // Add a strikethrough through the scheme.
422 [as addAttribute:NSStrikethroughStyleAttributeName
423 value:[NSNumber numberWithInt:NSUnderlineStyleSingle]
424 range:ComponentToNSRange(parts.scheme)];
421 } 425 }
422 [as addAttribute:NSForegroundColorAttributeName value:color 426 [as addAttribute:NSForegroundColorAttributeName value:color
423 range:ComponentToNSRange(parts.scheme)]; 427 range:ComponentToNSRange(parts.scheme)];
424 } 428 }
425 429
426 [field_ setObjectValue:as]; 430 [field_ setObjectValue:as];
427 431
428 // TODO(shess): This may be an appropriate place to call: 432 // TODO(shess): This may be an appropriate place to call:
429 // controller_->OnChanged(); 433 // controller_->OnChanged();
430 // In the current implementation, this tells LocationBarViewMac to 434 // In the current implementation, this tells LocationBarViewMac to
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 - (void)control:(NSControl*)control textDidPasteAndGo:(NSText*)fieldEditor { 877 - (void)control:(NSControl*)control textDidPasteAndGo:(NSText*)fieldEditor {
874 edit_view_->OnPasteAndGo(); 878 edit_view_->OnPasteAndGo();
875 } 879 }
876 880
877 // Signal that we've lost focus when the window resigns key. 881 // Signal that we've lost focus when the window resigns key.
878 - (void)windowDidResignKey:(NSNotification*)notification { 882 - (void)windowDidResignKey:(NSNotification*)notification {
879 edit_view_->OnDidResignKey(); 883 edit_view_->OnDidResignKey();
880 } 884 }
881 885
882 @end 886 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698