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

Unified Diff: chrome/browser/cocoa/button_with_viewid.mm

Issue 2973004: [Mac]Implement ViewID support. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Turns out that, it's not a good solution. Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/button_with_viewid.h ('k') | chrome/browser/cocoa/delayedmenu_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/cocoa/button_with_viewid.h ('k') | chrome/browser/cocoa/delayedmenu_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698