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_constants.h" | 9 #include "ui/app_list/app_list_constants.h" |
10 #include "ui/app_list/app_list_model.h" | 10 #include "ui/app_list/app_list_model.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 views::Button::STATE_NORMAL, &speech_button_prop->off_icon); | 259 views::Button::STATE_NORMAL, &speech_button_prop->off_icon); |
260 speech_button_->SetTooltipText(speech_button_prop->off_tooltip); | 260 speech_button_->SetTooltipText(speech_button_prop->off_tooltip); |
261 } | 261 } |
262 } else { | 262 } else { |
263 if (speech_button_) { | 263 if (speech_button_) { |
264 // Deleting a view will detach it from its parent. | 264 // Deleting a view will detach it from its parent. |
265 delete speech_button_; | 265 delete speech_button_; |
266 speech_button_ = NULL; | 266 speech_button_ = NULL; |
267 } | 267 } |
268 } | 268 } |
269 Layout(); | |
270 } | 269 } |
271 | 270 |
272 void SearchBoxView::HintTextChanged() { | 271 void SearchBoxView::HintTextChanged() { |
273 search_box_->set_placeholder_text(model_->search_box()->hint_text()); | 272 search_box_->set_placeholder_text(model_->search_box()->hint_text()); |
274 } | 273 } |
275 | 274 |
276 void SearchBoxView::SelectionModelChanged() { | 275 void SearchBoxView::SelectionModelChanged() { |
277 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); | 276 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); |
278 } | 277 } |
279 | 278 |
280 void SearchBoxView::TextChanged() { | 279 void SearchBoxView::TextChanged() { |
281 search_box_->SetText(model_->search_box()->text()); | 280 search_box_->SetText(model_->search_box()->text()); |
282 NotifyQueryChanged(); | 281 NotifyQueryChanged(); |
283 } | 282 } |
284 | 283 |
285 void SearchBoxView::OnSpeechRecognitionStateChanged( | 284 void SearchBoxView::OnSpeechRecognitionStateChanged( |
286 SpeechRecognitionState new_state) { | 285 SpeechRecognitionState new_state) { |
287 SpeechRecognitionButtonPropChanged(); | 286 SpeechRecognitionButtonPropChanged(); |
288 SchedulePaint(); | 287 SchedulePaint(); |
289 } | 288 } |
290 | 289 |
291 } // namespace app_list | 290 } // namespace app_list |
OLD | NEW |