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