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

Side by Side Diff: chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm

Issue 1884383003: AppMenu: add accessibility descriptions to zoom buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « 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/app_menu/app_menu_controller.h" 5 #import "chrome/browser/ui/cocoa/app_menu/app_menu_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/mac/bundle_locations.h" 10 #include "base/mac/bundle_locations.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 zoom_level_observer_.reset( 355 zoom_level_observer_.reset(
356 new AppMenuControllerInternal::ZoomLevelObserver( 356 new AppMenuControllerInternal::ZoomLevelObserver(
357 self, 357 self,
358 ui_zoom::ZoomEventManager::GetForBrowserContext( 358 ui_zoom::ZoomEventManager::GetForBrowserContext(
359 browser_->profile()))); 359 browser_->profile())));
360 NSString* title = base::SysUTF16ToNSString( 360 NSString* title = base::SysUTF16ToNSString(
361 [self appMenuModel]->GetLabelForCommandId(IDC_ZOOM_PERCENT_DISPLAY)); 361 [self appMenuModel]->GetLabelForCommandId(IDC_ZOOM_PERCENT_DISPLAY));
362 [[[buttonViewController_ zoomItem] viewWithTag:IDC_ZOOM_PERCENT_DISPLAY] 362 [[[buttonViewController_ zoomItem] viewWithTag:IDC_ZOOM_PERCENT_DISPLAY]
363 setTitle:title]; 363 setTitle:title];
364 [[[[buttonViewController_ zoomItem]
365 viewWithTag:IDC_ZOOM_MINUS] image]
366 setAccessibilityDescription:l10n_util::GetNSString(
367 IDS_TEXT_SMALLER_MAC)];
368 [[[[buttonViewController_ zoomItem]
369 viewWithTag:IDC_ZOOM_PLUS] image]
370 setAccessibilityDescription:l10n_util::GetNSString(
371 IDS_TEXT_BIGGER_MAC)];
364 content::RecordAction(UserMetricsAction("ShowAppMenu")); 372 content::RecordAction(UserMetricsAction("ShowAppMenu"));
365 373
366 NSImage* icon = [self appMenuModel]->browser()->window()->IsFullscreen() 374 NSImage* icon = [self appMenuModel]->browser()->window()->IsFullscreen()
367 ? [NSImage imageNamed:NSImageNameExitFullScreenTemplate] 375 ? [NSImage imageNamed:NSImageNameExitFullScreenTemplate]
368 : [NSImage imageNamed:NSImageNameEnterFullScreenTemplate]; 376 : [NSImage imageNamed:NSImageNameEnterFullScreenTemplate];
369 [[buttonViewController_ zoomFullScreen] setImage:icon]; 377 [[buttonViewController_ zoomFullScreen] setImage:icon];
370 378
371 menuOpenTime_ = base::TimeTicks::Now(); 379 menuOpenTime_ = base::TimeTicks::Now();
372 } 380 }
373 381
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 // (and thus, after all our ability to adjust it normally). Throw in the 634 // (and thus, after all our ability to adjust it normally). Throw in the
627 // towel, and simply don't let the frame move from where it's supposed to be. 635 // towel, and simply don't let the frame move from where it's supposed to be.
628 // TODO(devlin): Yet another Cocoa hack. It'd be good to find a workaround, 636 // TODO(devlin): Yet another Cocoa hack. It'd be good to find a workaround,
629 // but unlikely unless we replace the Cocoa menu implementation. 637 // but unlikely unless we replace the Cocoa menu implementation.
630 NSView* containerSuperview = [overflowActionsContainerView_ superview]; 638 NSView* containerSuperview = [overflowActionsContainerView_ superview];
631 if (NSMinX([containerSuperview frame]) != 0) 639 if (NSMinX([containerSuperview frame]) != 0)
632 [containerSuperview setFrameOrigin:NSZeroPoint]; 640 [containerSuperview setFrameOrigin:NSZeroPoint];
633 } 641 }
634 642
635 @end // @implementation AppMenuButtonViewController 643 @end // @implementation AppMenuButtonViewController
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