OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "chrome/browser/cocoa/button_with_viewid.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #import "chrome/browser/cocoa/view_id_util.h" |
| 9 |
| 10 @implementation ButtonWithViewID |
| 11 |
| 12 @synthesize command = command_; |
| 13 |
| 14 // We use the tag property solely for VIewID support. So override this method |
| 15 // to avoid misuse of the tag property. |
| 16 - (void)setTag:(NSInteger)anInt { |
| 17 NOTREACHED() << |
| 18 "NSView's tag is being used for ViewIDs. You are probably trying to use " |
| 19 "them for some other purpose. See http://dev.chromium.org/developers/" |
| 20 "design-documents/viewid-support-on-mac for details."; |
| 21 } |
| 22 |
| 23 - (void)setViewID:(ViewID)viewID { |
| 24 // We call [super setTag:] here because it's overridden by us. |
| 25 [super setTag:view_id_util::ViewIDToTag(viewID)]; |
| 26 } |
| 27 |
| 28 @end // @interface ButtonWithViewID |
OLD | NEW |