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

Side by Side Diff: chrome/browser/ui/cocoa/gradient_button_cell.mm

Issue 2082383004: [Material][Mac] Fix for Bookmark Button's highlight issues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698