| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/cocoa/gradient_button_cell.h" | 5 #include "chrome/browser/ui/cocoa/gradient_button_cell.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 return [super startTrackingAt:startPoint inView:controlView]; | 339 return [super startTrackingAt:startPoint inView:controlView]; |
| 340 } | 340 } |
| 341 | 341 |
| 342 // Since we have our own drawWithFrame:, we need to also have our own | 342 // Since we have our own drawWithFrame:, we need to also have our own |
| 343 // logic for determining when the mouse is inside for honoring this | 343 // logic for determining when the mouse is inside for honoring this |
| 344 // request. | 344 // request. |
| 345 - (void)setShowsBorderOnlyWhileMouseInside:(BOOL)showOnly { | 345 - (void)setShowsBorderOnlyWhileMouseInside:(BOOL)showOnly { |
| 346 [super setShowsBorderOnlyWhileMouseInside:showOnly]; | 346 [super setShowsBorderOnlyWhileMouseInside:showOnly]; |
| 347 if (showOnly) { | 347 if (showOnly) { |
| 348 [self updateTrackingAreas]; | 348 [self updateTrackingAreas]; |
| 349 if ([self tag] == kMaterialStandardButtonTypeWithLimitedClickFeedback) |
| 350 [self setHighlighted:isMouseInside_]; |
| 349 } else { | 351 } else { |
| 350 if (trackingArea_) { | 352 if (trackingArea_) { |
| 351 [[self controlView] removeTrackingArea:trackingArea_]; | 353 [[self controlView] removeTrackingArea:trackingArea_]; |
| 352 trackingArea_.reset(nil); | 354 trackingArea_.reset(nil); |
| 353 if (isMouseInside_) { | 355 if (isMouseInside_) { |
| 354 isMouseInside_ = NO; | 356 isMouseInside_ = NO; |
| 355 [[self controlView] setNeedsDisplay:YES]; | 357 [[self controlView] setNeedsDisplay:YES]; |
| 356 } | 358 } |
| 357 } | 359 } |
| 358 } | 360 } |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 options:options | 845 options:options |
| 844 owner:self | 846 owner:self |
| 845 userInfo:nil]); | 847 userInfo:nil]); |
| 846 if (isMouseInside_ != mouseInView) { | 848 if (isMouseInside_ != mouseInView) { |
| 847 [self setMouseInside:mouseInView animate:NO]; | 849 [self setMouseInside:mouseInView animate:NO]; |
| 848 [controlView setNeedsDisplay:YES]; | 850 [controlView setNeedsDisplay:YES]; |
| 849 } | 851 } |
| 850 } | 852 } |
| 851 | 853 |
| 852 @end | 854 @end |
| OLD | NEW |