| 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(); |
| 269 } | 270 } |
| 270 | 271 |
| 271 void SearchBoxView::HintTextChanged() { | 272 void SearchBoxView::HintTextChanged() { |
| 272 search_box_->set_placeholder_text(model_->search_box()->hint_text()); | 273 search_box_->set_placeholder_text(model_->search_box()->hint_text()); |
| 273 } | 274 } |
| 274 | 275 |
| 275 void SearchBoxView::SelectionModelChanged() { | 276 void SearchBoxView::SelectionModelChanged() { |
| 276 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); | 277 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); |
| 277 } | 278 } |
| 278 | 279 |
| 279 void SearchBoxView::TextChanged() { | 280 void SearchBoxView::TextChanged() { |
| 280 search_box_->SetText(model_->search_box()->text()); | 281 search_box_->SetText(model_->search_box()->text()); |
| 281 NotifyQueryChanged(); | 282 NotifyQueryChanged(); |
| 282 } | 283 } |
| 283 | 284 |
| 284 void SearchBoxView::OnSpeechRecognitionStateChanged( | 285 void SearchBoxView::OnSpeechRecognitionStateChanged( |
| 285 SpeechRecognitionState new_state) { | 286 SpeechRecognitionState new_state) { |
| 286 SpeechRecognitionButtonPropChanged(); | 287 SpeechRecognitionButtonPropChanged(); |
| 287 SchedulePaint(); | 288 SchedulePaint(); |
| 288 } | 289 } |
| 289 | 290 |
| 290 } // namespace app_list | 291 } // namespace app_list |
| OLD | NEW |