Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/ui/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 996 // top-of-window views revealed. | 996 // top-of-window views revealed. |
| 997 scoped_ptr<ImmersiveRevealedLock> focus_reveal_lock( | 997 scoped_ptr<ImmersiveRevealedLock> focus_reveal_lock( |
| 998 immersive_mode_controller_->GetRevealedLock( | 998 immersive_mode_controller_->GetRevealedLock( |
| 999 ImmersiveModeController::ANIMATE_REVEAL_YES)); | 999 ImmersiveModeController::ANIMATE_REVEAL_YES)); |
| 1000 | 1000 |
| 1001 LocationBarView* location_bar = GetLocationBarView(); | 1001 LocationBarView* location_bar = GetLocationBarView(); |
| 1002 if (location_bar->omnibox_view()->IsFocusable()) { | 1002 if (location_bar->omnibox_view()->IsFocusable()) { |
| 1003 // Location bar got focus. | 1003 // Location bar got focus. |
| 1004 // | 1004 // |
| 1005 // select_all is true when it's expected that the user may want to copy | 1005 // select_all is true when it's expected that the user may want to copy |
| 1006 // the URL to the clipboard. If the URL is not being shown because the | 1006 // the URL to the clipboard. |
| 1007 // origin chip is enabled, show it now to support the same functionality. | 1007 if (select_all) |
|
Justin Donnelly
2014/11/21 19:15:24
If we get rid of the search button then these few
groby-ooo-7-16
2014/12/02 18:40:10
We can get rid of them even without the search but
| |
| 1008 if (select_all && | |
| 1009 location_bar->GetToolbarModel()->WouldOmitURLDueToOriginChip()) | |
| 1010 location_bar->ShowURL(); | 1008 location_bar->ShowURL(); |
| 1011 else | 1009 else |
| 1012 location_bar->FocusLocation(select_all); | 1010 location_bar->FocusLocation(select_all); |
| 1013 } else { | 1011 } else { |
| 1014 // If none of location bar got focus, then clear focus. | 1012 // If none of location bar got focus, then clear focus. |
| 1015 views::FocusManager* focus_manager = GetFocusManager(); | 1013 views::FocusManager* focus_manager = GetFocusManager(); |
| 1016 DCHECK(focus_manager); | 1014 DCHECK(focus_manager); |
| 1017 focus_manager->ClearFocus(); | 1015 focus_manager->ClearFocus(); |
| 1018 } | 1016 } |
| 1019 } | 1017 } |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2505 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2503 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2506 gfx::Point icon_bottom( | 2504 gfx::Point icon_bottom( |
| 2507 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2505 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2508 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2506 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2509 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); | 2507 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); |
| 2510 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2508 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2511 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2509 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2512 } | 2510 } |
| 2513 return top_arrow_height; | 2511 return top_arrow_height; |
| 2514 } | 2512 } |
| OLD | NEW |