Home | History | Annotate | Download | only in cocoa
      1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_NEW_TAB_BUTTON
      6 #define CHROME_BROWSER_UI_COCOA_NEW_TAB_BUTTON
      7 #pragma once
      8 
      9 #import <Cocoa/Cocoa.h>
     10 
     11 #include "base/memory/scoped_nsobject.h"
     12 
     13 // Overrides hit-test behavior to only accept clicks inside the image of the
     14 // button, not just inside the bounding box. This could be abstracted to general
     15 // use, but no other buttons are so irregularly shaped with respect to their
     16 // bounding box.
     17 
     18 @interface NewTabButton : NSButton {
     19  @private
     20   scoped_nsobject<NSBezierPath> imagePath_;
     21 }
     22 
     23 // Returns YES if the given point is over the button.  |point| is in the
     24 // superview's coordinate system.
     25 - (BOOL)pointIsOverButton:(NSPoint)point;
     26 @end
     27 
     28 #endif  // CHROME_BROWSER_UI_COCOA_NEW_TAB_BUTTON
     29