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

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

Issue 2679273002: [Mac] Retain location bar focus on switching to fullscreen and back. (Closed)
Patch Set: Fix regression with the toolbar not dropping down. Created 3 years, 10 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
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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 - (LocationBarViewMac*)locationBarBridge { 569 - (LocationBarViewMac*)locationBarBridge {
570 return locationBarView_.get(); 570 return locationBarView_.get();
571 } 571 }
572 572
573 - (void)locationBarWasAddedToWindow { 573 - (void)locationBarWasAddedToWindow {
574 // Allow the |locationBarView_| to update itself to match the browser window 574 // Allow the |locationBarView_| to update itself to match the browser window
575 // theme. 575 // theme.
576 locationBarView_->OnAddedToWindow(); 576 locationBarView_->OnAddedToWindow();
577 } 577 }
578 578
579 - (BOOL)locationBarHasFocus {
580 return [[autocompleteTextFieldEditor_ window] firstResponder] ==
581 autocompleteTextFieldEditor_.get();
582 }
583
579 - (void)focusLocationBar:(BOOL)selectAll { 584 - (void)focusLocationBar:(BOOL)selectAll {
580 if (locationBarView_.get()) { 585 if (locationBarView_.get()) {
581 locationBarView_->FocusLocation(selectAll ? true : false); 586 locationBarView_->FocusLocation(selectAll ? true : false);
582 } 587 }
583 } 588 }
584 589
585 // Called when the state for a command changes to |enabled|. Update the 590 // Called when the state for a command changes to |enabled|. Update the
586 // corresponding UI element. 591 // corresponding UI element.
587 - (void)enabledStateChangedForCommand:(int)command enabled:(bool)enabled { 592 - (void)enabledStateChangedForCommand:(int)command enabled:(bool)enabled {
588 NSButton* button = nil; 593 NSButton* button = nil;
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 - (void)hideDropURLsIndicatorInView:(NSView*)view { 1095 - (void)hideDropURLsIndicatorInView:(NSView*)view {
1091 // Do nothing. 1096 // Do nothing.
1092 } 1097 }
1093 1098
1094 // (URLDropTargetController protocol) 1099 // (URLDropTargetController protocol)
1095 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { 1100 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info {
1096 return drag_util::IsUnsupportedDropData(profile_, info); 1101 return drag_util::IsUnsupportedDropData(profile_, info);
1097 } 1102 }
1098 1103
1099 @end 1104 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698