| 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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 | 693 |
| 694 if (is_popup_mode_) { | 694 if (is_popup_mode_) { |
| 695 state->AddStateFlag(ui::AX_STATE_READ_ONLY); | 695 state->AddStateFlag(ui::AX_STATE_READ_ONLY); |
| 696 } else { | 696 } else { |
| 697 state->set_value_callback = | 697 state->set_value_callback = |
| 698 base::Bind(&LocationBarView::AccessibilitySetValue, | 698 base::Bind(&LocationBarView::AccessibilitySetValue, |
| 699 weak_ptr_factory_.GetWeakPtr()); | 699 weak_ptr_factory_.GetWeakPtr()); |
| 700 } | 700 } |
| 701 } | 701 } |
| 702 | 702 |
| 703 gfx::Size LocationBarView::GetPreferredSize() { | 703 gfx::Size LocationBarView::GetPreferredSize() const { |
| 704 // Compute minimum height. | 704 // Compute minimum height. |
| 705 gfx::Size min_size(border_painter_->GetMinimumSize()); | 705 gfx::Size min_size(border_painter_->GetMinimumSize()); |
| 706 if (!IsInitialized()) | 706 if (!IsInitialized()) |
| 707 return min_size; | 707 return min_size; |
| 708 gfx::Size search_button_min_size(search_button_->GetMinimumSize()); | 708 gfx::Size search_button_min_size(search_button_->GetMinimumSize()); |
| 709 min_size.SetToMax(search_button_min_size); | 709 min_size.SetToMax(search_button_min_size); |
| 710 | 710 |
| 711 // Compute width of omnibox-leading content. | 711 // Compute width of omnibox-leading content. |
| 712 const int horizontal_edge_thickness = GetHorizontalEdgeThickness(); | 712 const int horizontal_edge_thickness = GetHorizontalEdgeThickness(); |
| 713 int leading_width = horizontal_edge_thickness; | 713 int leading_width = horizontal_edge_thickness; |
| (...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1689 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1689 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1690 const SearchModel::State& new_state) { | 1690 const SearchModel::State& new_state) { |
| 1691 const bool visible = !GetToolbarModel()->input_in_progress() && | 1691 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1692 new_state.voice_search_supported; | 1692 new_state.voice_search_supported; |
| 1693 if (mic_search_view_->visible() != visible) { | 1693 if (mic_search_view_->visible() != visible) { |
| 1694 mic_search_view_->SetVisible(visible); | 1694 mic_search_view_->SetVisible(visible); |
| 1695 Layout(); | 1695 Layout(); |
| 1696 } | 1696 } |
| 1697 } | 1697 } |
| 1698 | 1698 |
| OLD | NEW |