| 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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 | 690 |
| 691 if (is_popup_mode_) { | 691 if (is_popup_mode_) { |
| 692 state->AddStateFlag(ui::AX_STATE_READ_ONLY); | 692 state->AddStateFlag(ui::AX_STATE_READ_ONLY); |
| 693 } else { | 693 } else { |
| 694 state->set_value_callback = | 694 state->set_value_callback = |
| 695 base::Bind(&LocationBarView::AccessibilitySetValue, | 695 base::Bind(&LocationBarView::AccessibilitySetValue, |
| 696 weak_ptr_factory_.GetWeakPtr()); | 696 weak_ptr_factory_.GetWeakPtr()); |
| 697 } | 697 } |
| 698 } | 698 } |
| 699 | 699 |
| 700 gfx::Size LocationBarView::GetPreferredSize() { | 700 gfx::Size LocationBarView::GetPreferredSize() const { |
| 701 gfx::Size background_min_size(border_painter_->GetMinimumSize()); | 701 gfx::Size background_min_size(border_painter_->GetMinimumSize()); |
| 702 if (!IsInitialized()) | 702 if (!IsInitialized()) |
| 703 return background_min_size; | 703 return background_min_size; |
| 704 | 704 |
| 705 gfx::Size origin_chip_view_min_size(origin_chip_view_->GetMinimumSize()); | 705 gfx::Size origin_chip_view_min_size(origin_chip_view_->GetMinimumSize()); |
| 706 gfx::Size search_button_min_size(search_button_->GetMinimumSize()); | 706 gfx::Size search_button_min_size(search_button_->GetMinimumSize()); |
| 707 gfx::Size min_size(background_min_size); | 707 gfx::Size min_size(background_min_size); |
| 708 min_size.SetToMax(search_button_min_size); | 708 min_size.SetToMax(search_button_min_size); |
| 709 min_size.set_width(origin_chip_view_min_size.width() + | 709 min_size.set_width(origin_chip_view_min_size.width() + |
| 710 background_min_size.width() + | 710 background_min_size.width() + |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1642 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1643 const SearchModel::State& new_state) { | 1643 const SearchModel::State& new_state) { |
| 1644 const bool visible = !GetToolbarModel()->input_in_progress() && | 1644 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1645 new_state.voice_search_supported; | 1645 new_state.voice_search_supported; |
| 1646 if (mic_search_view_->visible() != visible) { | 1646 if (mic_search_view_->visible() != visible) { |
| 1647 mic_search_view_->SetVisible(visible); | 1647 mic_search_view_->SetVisible(visible); |
| 1648 Layout(); | 1648 Layout(); |
| 1649 } | 1649 } |
| 1650 } | 1650 } |
| 1651 | 1651 |
| OLD | NEW |