Index: chrome/browser/cocoa/button_with_viewid.mm |
diff --git a/chrome/browser/cocoa/button_with_viewid.mm b/chrome/browser/cocoa/button_with_viewid.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3eb92d2e11d7f12ce362c8797f970f76db32763d |
--- /dev/null |
+++ b/chrome/browser/cocoa/button_with_viewid.mm |
@@ -0,0 +1,28 @@ |
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import "chrome/browser/cocoa/button_with_viewid.h" |
+ |
+#include "base/logging.h" |
+#import "chrome/browser/cocoa/view_id_util.h" |
+ |
+@implementation ButtonWithViewID |
+ |
+@synthesize command = command_; |
+ |
+// We use the tag property solely for VIewID support. So override this method |
+// to avoid misuse of the tag property. |
+- (void)setTag:(NSInteger)anInt { |
+ NOTREACHED() << |
+ "NSView's tag is being used for ViewIDs. You are probably trying to use " |
+ "them for some other purpose. See http://dev.chromium.org/developers/" |
+ "design-documents/viewid-support-on-mac for details."; |
+} |
+ |
+- (void)setViewID:(ViewID)viewID { |
+ // We call [super setTag:] here because it's overridden by us. |
+ [super setTag:view_id_util::ViewIDToTag(viewID)]; |
+} |
+ |
+@end // @interface ButtonWithViewID |