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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 | 1050 |
1051 LocationBarView* location_bar = GetLocationBarView(); | 1051 LocationBarView* location_bar = GetLocationBarView(); |
1052 if (location_bar->omnibox_view()->IsFocusable()) { | 1052 if (location_bar->omnibox_view()->IsFocusable()) { |
1053 // Location bar got focus. | 1053 // Location bar got focus. |
1054 // | 1054 // |
1055 // select_all is true when it's expected that the user may want to copy | 1055 // select_all is true when it's expected that the user may want to copy |
1056 // the URL to the clipboard. If the URL is not being shown because the | 1056 // the URL to the clipboard. If the URL is not being shown because the |
1057 // origin chip is enabled, show it now to support the same functionality. | 1057 // origin chip is enabled, show it now to support the same functionality. |
1058 if (select_all && | 1058 if (select_all && |
1059 location_bar->GetToolbarModel()->WouldOmitURLDueToOriginChip()) | 1059 location_bar->GetToolbarModel()->WouldOmitURLDueToOriginChip()) |
1060 location_bar->omnibox_view()->ShowURL(); | 1060 location_bar->ShowURL(); |
1061 else | 1061 else |
1062 location_bar->FocusLocation(select_all); | 1062 location_bar->FocusLocation(select_all); |
1063 } else { | 1063 } else { |
1064 // If none of location bar got focus, then clear focus. | 1064 // If none of location bar got focus, then clear focus. |
1065 views::FocusManager* focus_manager = GetFocusManager(); | 1065 views::FocusManager* focus_manager = GetFocusManager(); |
1066 DCHECK(focus_manager); | 1066 DCHECK(focus_manager); |
1067 focus_manager->ClearFocus(); | 1067 focus_manager->ClearFocus(); |
1068 } | 1068 } |
1069 } | 1069 } |
1070 | 1070 |
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2584 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2584 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2585 gfx::Point icon_bottom( | 2585 gfx::Point icon_bottom( |
2586 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2586 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2587 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2587 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2588 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2588 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2589 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2589 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2590 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2590 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2591 } | 2591 } |
2592 return top_arrow_height; | 2592 return top_arrow_height; |
2593 } | 2593 } |
OLD | NEW |