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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

Issue 2091063002: Location bar: make decorations accessible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: first round 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/location_bar/location_bar_view_mac.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 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 [forwardButton_ setHandleMiddleClick:YES]; 443 [forwardButton_ setHandleMiddleClick:YES];
444 [reloadButton_ setHandleMiddleClick:YES]; 444 [reloadButton_ setHandleMiddleClick:YES];
445 [homeButton_ setHandleMiddleClick:YES]; 445 [homeButton_ setHandleMiddleClick:YES];
446 446
447 [self initCommandStatus:commands_]; 447 [self initCommandStatus:commands_];
448 [reloadButton_ setCommandUpdater:commands_]; 448 [reloadButton_ setCommandUpdater:commands_];
449 449
450 locationBarView_.reset(new LocationBarViewMac(locationBar_, commands_, 450 locationBarView_.reset(new LocationBarViewMac(locationBar_, commands_,
451 profile_, browser_)); 451 profile_, browser_));
452 [locationBar_ setFont:[NSFont systemFontOfSize:14]]; 452 [locationBar_ setFont:[NSFont systemFontOfSize:14]];
453
454 // Add the location bar's accessibility views as direct subviews of the
455 // toolbar. They are logical children of the location bar, but the location
456 // bar's actual Cocoa control is an NSCell, so it cannot have child views.
457 // The |locationBarView_| is responsible for positioning the accessibility
458 // views.
459 std::vector<NSView*> accessibility_views =
460 locationBarView_->GetDecorationAccessibilityViews();
461 for (const auto& view : accessibility_views) {
462 [[self toolbarView] addSubview:view
463 positioned:NSWindowAbove
464 relativeTo:locationBar_];
465 }
466
453 if (!isModeMaterial) { 467 if (!isModeMaterial) {
454 [locationBar_ setFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]]; 468 [locationBar_ setFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]];
455 } 469 }
456 470
457 // Register pref observers for the optional home and page/options buttons 471 // Register pref observers for the optional home and page/options buttons
458 // and then add them to the toolbar based on those prefs. 472 // and then add them to the toolbar based on those prefs.
459 PrefService* prefs = profile_->GetPrefs(); 473 PrefService* prefs = profile_->GetPrefs();
460 showHomeButton_.Init( 474 showHomeButton_.Init(
461 prefs::kShowHomeButton, prefs, 475 prefs::kShowHomeButton, prefs,
462 base::Bind( 476 base::Bind(
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 - (void)hideDropURLsIndicatorInView:(NSView*)view { 1169 - (void)hideDropURLsIndicatorInView:(NSView*)view {
1156 // Do nothing. 1170 // Do nothing.
1157 } 1171 }
1158 1172
1159 // (URLDropTargetController protocol) 1173 // (URLDropTargetController protocol)
1160 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { 1174 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info {
1161 return drag_util::IsUnsupportedDropData(profile_, info); 1175 return drag_util::IsUnsupportedDropData(profile_, info);
1162 } 1176 }
1163 1177
1164 @end 1178 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698