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 "ui/app_list/views/search_box_view.h" | 5 #include "ui/app_list/views/search_box_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/app_list/app_list_model.h" | 9 #include "ui/app_list/app_list_model.h" |
10 #include "ui/app_list/app_list_switches.h" | 10 #include "ui/app_list/app_list_switches.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 speech_button_(NULL), | 87 speech_button_(NULL), |
88 search_box_(new views::Textfield), | 88 search_box_(new views::Textfield), |
89 contents_view_(NULL) { | 89 contents_view_(NULL) { |
90 if (switches::IsExperimentalAppListEnabled()) { | 90 if (switches::IsExperimentalAppListEnabled()) { |
91 set_background(new SearchBoxBackground()); | 91 set_background(new SearchBoxBackground()); |
92 } else { | 92 } else { |
93 icon_view_ = new views::ImageView; | 93 icon_view_ = new views::ImageView; |
94 AddChildView(icon_view_); | 94 AddChildView(icon_view_); |
95 } | 95 } |
96 | 96 |
97 views::BoxLayout* layout = new views::BoxLayout( | 97 views::BoxLayout* layout = |
98 views::BoxLayout::kHorizontal, kPadding, 0, kPadding); | 98 new views::BoxLayout(views::BoxLayout::kHorizontal, |
| 99 kPadding, |
| 100 0, |
| 101 kPadding - views::Textfield::kTextPadding); |
99 SetLayoutManager(layout); | 102 SetLayoutManager(layout); |
100 layout->set_cross_axis_alignment( | 103 layout->set_cross_axis_alignment( |
101 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); | 104 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); |
102 layout->set_minimum_cross_axis_size(switches::IsExperimentalAppListEnabled() | 105 layout->set_minimum_cross_axis_size(switches::IsExperimentalAppListEnabled() |
103 ? kExperimentalSearchBoxHeight | 106 ? kExperimentalSearchBoxHeight |
104 : kPreferredHeight); | 107 : kPreferredHeight); |
105 | 108 |
106 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 109 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
107 | 110 |
108 search_box_->SetBorder(views::Border::NullBorder()); | 111 search_box_->SetBorder(views::Border::NullBorder()); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 NotifyQueryChanged(); | 270 NotifyQueryChanged(); |
268 } | 271 } |
269 | 272 |
270 void SearchBoxView::OnSpeechRecognitionStateChanged( | 273 void SearchBoxView::OnSpeechRecognitionStateChanged( |
271 SpeechRecognitionState new_state) { | 274 SpeechRecognitionState new_state) { |
272 SpeechRecognitionButtonPropChanged(); | 275 SpeechRecognitionButtonPropChanged(); |
273 SchedulePaint(); | 276 SchedulePaint(); |
274 } | 277 } |
275 | 278 |
276 } // namespace app_list | 279 } // namespace app_list |
OLD | NEW |