| OLD | NEW |
| 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 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 background_min_size.width() + | 710 background_min_size.width() + |
| 711 search_button_min_size.width()); | 711 search_button_min_size.width()); |
| 712 return min_size; | 712 return min_size; |
| 713 } | 713 } |
| 714 | 714 |
| 715 void LocationBarView::Layout() { | 715 void LocationBarView::Layout() { |
| 716 if (!IsInitialized()) | 716 if (!IsInitialized()) |
| 717 return; | 717 return; |
| 718 | 718 |
| 719 animated_host_label_->SetVisible(false); | 719 animated_host_label_->SetVisible(false); |
| 720 origin_chip_view_->SetVisible(origin_chip_view_->ShouldShow()); | 720 origin_chip_view_->SetVisible(GetToolbarModel()->ShouldShowOriginChip()); |
| 721 selected_keyword_view_->SetVisible(false); | 721 selected_keyword_view_->SetVisible(false); |
| 722 location_icon_view_->SetVisible(false); | 722 location_icon_view_->SetVisible(false); |
| 723 ev_bubble_view_->SetVisible(false); | 723 ev_bubble_view_->SetVisible(false); |
| 724 keyword_hint_view_->SetVisible(false); | 724 keyword_hint_view_->SetVisible(false); |
| 725 | 725 |
| 726 // The textfield has 1 px of whitespace before the text in the RTL case only. | 726 // The textfield has 1 px of whitespace before the text in the RTL case only. |
| 727 const int kEditLeadingInternalSpace = base::i18n::IsRTL() ? 1 : 0; | 727 const int kEditLeadingInternalSpace = base::i18n::IsRTL() ? 1 : 0; |
| 728 LocationBarLayout leading_decorations( | 728 LocationBarLayout leading_decorations( |
| 729 LocationBarLayout::LEFT_EDGE, kItemPadding - kEditLeadingInternalSpace); | 729 LocationBarLayout::LEFT_EDGE, kItemPadding - kEditLeadingInternalSpace); |
| 730 LocationBarLayout trailing_decorations(LocationBarLayout::RIGHT_EDGE, | 730 LocationBarLayout trailing_decorations(LocationBarLayout::RIGHT_EDGE, |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1652 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1653 const SearchModel::State& new_state) { | 1653 const SearchModel::State& new_state) { |
| 1654 const bool visible = !GetToolbarModel()->input_in_progress() && | 1654 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1655 new_state.voice_search_supported; | 1655 new_state.voice_search_supported; |
| 1656 if (mic_search_view_->visible() != visible) { | 1656 if (mic_search_view_->visible() != visible) { |
| 1657 mic_search_view_->SetVisible(visible); | 1657 mic_search_view_->SetVisible(visible); |
| 1658 Layout(); | 1658 Layout(); |
| 1659 } | 1659 } |
| 1660 } | 1660 } |
| 1661 | 1661 |
| OLD | NEW |