diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 17:34:59 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 17:34:59 +0000 |
commit | a866cc21b77be5881eef0039db0b5928587f0b54 (patch) | |
tree | 83c0375c7d2b1c48adb92cf41f981f5f84273d94 /chrome/browser/autocomplete | |
parent | e1df35e117fd5e243874bf9db9224b7112e51b34 (diff) | |
download | chromium_src-a866cc21b77be5881eef0039db0b5928587f0b54.zip chromium_src-a866cc21b77be5881eef0039db0b5928587f0b54.tar.gz chromium_src-a866cc21b77be5881eef0039db0b5928587f0b54.tar.bz2 |
Mac/clang: Possibly contentious changes.
As discussed on irc, we're getting rid of const NSObjects, and we're making all properties nonatomic.
const: All of cocoa takes nonconst NSObjects, and passing a const NSString to a function that takes NSString is a const violation. gcc doesn't complain about this, but clang intentionally does. constness is usually done via immutable base classes and mutable subclasses in cocoa anyway, so getting rid of const isn't that bad. Also, we don't really have a choice.
nonatomic: Some of our classes have custom setters that are not @synchronized. If the @property for that is not non-atomic, then the interface claims that the method is synchronized but the implementation actually isn't. That's a bug. gcc happens not to complain about this, but clang does. Since we shouldn't need atomic properties anywhere, the simple rule is now to just make all properties nonatomic.
Review URL: http://codereview.chromium.org/2769014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm | 12 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_mac.mm | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm index 720f3ac..b565e98 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm @@ -55,7 +55,7 @@ namespace { // TODO(shess): This is ugly, find a better way. Using it right now // so that I can crib from gtk and still be able to see that I'm using // the same values easily. -const NSColor* ColorWithRGBBytes(int rr, int gg, int bb) { +NSColor* ColorWithRGBBytes(int rr, int gg, int bb) { DCHECK_LE(rr, 255); DCHECK_LE(bb, 255); DCHECK_LE(gg, 255); @@ -65,19 +65,19 @@ const NSColor* ColorWithRGBBytes(int rr, int gg, int bb) { alpha:1.0]; } -const NSColor* HostTextColor() { +NSColor* HostTextColor() { return [NSColor blackColor]; } -const NSColor* BaseTextColor() { +NSColor* BaseTextColor() { return [NSColor darkGrayColor]; } -const NSColor* EVSecureSchemeColor() { +NSColor* EVSecureSchemeColor() { return ColorWithRGBBytes(0x07, 0x95, 0x00); } -const NSColor* SecureSchemeColor() { +NSColor* SecureSchemeColor() { return ColorWithRGBBytes(0x00, 0x0e, 0x95); } -const NSColor* SecurityErrorSchemeColor() { +NSColor* SecurityErrorSchemeColor() { return ColorWithRGBBytes(0xa2, 0x00, 0x00); } diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm index 5d31764..a8d494a 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm @@ -75,13 +75,13 @@ NSColor* HoveredBackgroundColor() { return [[NSColor controlHighlightColor] colorWithAlphaComponent:kPopupAlpha]; } -static const NSColor* ContentTextColor() { +static NSColor* ContentTextColor() { return [NSColor blackColor]; } -static const NSColor* URLTextColor() { +static NSColor* URLTextColor() { return [NSColor colorWithCalibratedRed:0.0 green:0.55 blue:0.0 alpha:1.0]; } -static const NSColor* DescriptionTextColor() { +static NSColor* DescriptionTextColor() { return [NSColor darkGrayColor]; } |