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

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

Issue 138983004: [OriginChip, OSX] Show & select URL on cmd-l. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
index 7cb950f768d033f06a04cf7ffd1d489b38fd0f6a..023442911e33bb7a21c26e776514320dee668f48 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
@@ -398,8 +398,17 @@ class NotificationBridge
}
- (void)focusLocationBar:(BOOL)selectAll {
- if (locationBarView_.get())
- locationBarView_->FocusLocation(selectAll ? true : false);
+ if (locationBarView_.get()) {
+ if (chrome::ShouldDisplayOriginChip() && selectAll) {
+ // select_all is true when it's expected that the user may want to copy
+ // the URL to the clipboard. If the origin chip is being displayed (and
+ // thus the URL is not being shown in the Omnibox) show it now to support
+ // the same functionality.
+ locationBarView_->GetOmniboxView()->ShowURL();
+ } else {
+ locationBarView_->FocusLocation(selectAll ? true : false);
+ }
+ }
}
// Called when the state for a command changes to |enabled|. Update the
« 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