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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm

Issue 7027017: Mac. Fix bug where accessibility gives a stuck highlight on item 1 of bookmark folder menus. Just... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2011 The Chromium Authors. All rights reserved. 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 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 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/memory/scoped_nsobject.h" 8 #import "base/memory/scoped_nsobject.h"
9 #include "chrome/browser/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 345
346 - (void)mouseDragged:(NSEvent*)theEvent { 346 - (void)mouseDragged:(NSEvent*)theEvent {
347 if ([delegate_ respondsToSelector:@selector(mouseDragged:)]) 347 if ([delegate_ respondsToSelector:@selector(mouseDragged:)])
348 [id(delegate_) mouseDragged:theEvent]; 348 [id(delegate_) mouseDragged:theEvent];
349 } 349 }
350 350
351 + (BookmarkButton*)draggedButton { 351 + (BookmarkButton*)draggedButton {
352 return gDraggedButton; 352 return gDraggedButton;
353 } 353 }
354 354
355 - (BOOL)canBecomeKeyView {
356 // If button is an item in a folder menu, don't become key.
357 return ![[self cell] isFolderButtonCell];
358 }
359
355 // This only gets called after a click that wasn't a drag, and only on folders. 360 // This only gets called after a click that wasn't a drag, and only on folders.
356 - (void)secondaryMouseUpAction:(BOOL)wasInside { 361 - (void)secondaryMouseUpAction:(BOOL)wasInside {
357 const NSTimeInterval kShortClickLength = 0.5; 362 const NSTimeInterval kShortClickLength = 0.5;
358 // Long clicks that end over the folder button result in the menu hiding. 363 // Long clicks that end over the folder button result in the menu hiding.
359 if (wasInside && ([self durationMouseWasDown] > kShortClickLength)) { 364 if (wasInside && ([self durationMouseWasDown] > kShortClickLength)) {
360 [[self target] performSelector:[self action] withObject:self]; 365 [[self target] performSelector:[self action] withObject:self];
361 } else { 366 } else {
362 // Mouse tracked out of button during menu track. Hide menus. 367 // Mouse tracked out of button during menu track. Hide menus.
363 if (!wasInside) 368 if (!wasInside)
364 [delegate_ bookmarkDragDidEnd:self 369 [delegate_ bookmarkDragDidEnd:self
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 [image drawAtPoint:NSMakePoint(0, 0) 422 [image drawAtPoint:NSMakePoint(0, 0)
418 fromRect:NSMakeRect(0, 0, NSWidth(bounds), NSHeight(bounds)) 423 fromRect:NSMakeRect(0, 0, NSWidth(bounds), NSHeight(bounds))
419 operation:NSCompositeSourceOver 424 operation:NSCompositeSourceOver
420 fraction:kDragImageOpacity]; 425 fraction:kDragImageOpacity];
421 426
422 [dragImage unlockFocus]; 427 [dragImage unlockFocus];
423 return dragImage; 428 return dragImage;
424 } 429 }
425 430
426 @end // @implementation BookmarkButton(Private) 431 @end // @implementation BookmarkButton(Private)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698