Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: ui/app_list/views/search_box_view.cc

Issue 2846733004: Optimization: not sending answer server requests for voice queries. (Closed)
Patch Set: Last nits Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/views/search_box_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 void SearchBoxView::OnEnabledChanged() { 298 void SearchBoxView::OnEnabledChanged() {
299 search_box_->SetEnabled(enabled()); 299 search_box_->SetEnabled(enabled());
300 if (speech_button_) 300 if (speech_button_)
301 speech_button_->SetEnabled(enabled()); 301 speech_button_->SetEnabled(enabled());
302 } 302 }
303 303
304 void SearchBoxView::UpdateModel() { 304 void SearchBoxView::UpdateModel() {
305 // Temporarily remove from observer to ignore notifications caused by us. 305 // Temporarily remove from observer to ignore notifications caused by us.
306 model_->search_box()->RemoveObserver(this); 306 model_->search_box()->RemoveObserver(this);
307 model_->search_box()->SetText(search_box_->text()); 307 model_->search_box()->Update(search_box_->text(), false);
308 model_->search_box()->SetSelectionModel(search_box_->GetSelectionModel()); 308 model_->search_box()->SetSelectionModel(search_box_->GetSelectionModel());
309 model_->search_box()->AddObserver(this); 309 model_->search_box()->AddObserver(this);
310 } 310 }
311 311
312 void SearchBoxView::NotifyQueryChanged() { 312 void SearchBoxView::NotifyQueryChanged() {
313 DCHECK(delegate_); 313 DCHECK(delegate_);
314 delegate_->QueryChanged(this); 314 delegate_->QueryChanged(this);
315 } 315 }
316 316
317 void SearchBoxView::ContentsChanged(views::Textfield* sender, 317 void SearchBoxView::ContentsChanged(views::Textfield* sender,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 void SearchBoxView::HintTextChanged() { 415 void SearchBoxView::HintTextChanged() {
416 const app_list::SearchBoxModel* search_box = model_->search_box(); 416 const app_list::SearchBoxModel* search_box = model_->search_box();
417 search_box_->set_placeholder_text(search_box->hint_text()); 417 search_box_->set_placeholder_text(search_box->hint_text());
418 search_box_->SetAccessibleName(search_box->accessible_name()); 418 search_box_->SetAccessibleName(search_box->accessible_name());
419 } 419 }
420 420
421 void SearchBoxView::SelectionModelChanged() { 421 void SearchBoxView::SelectionModelChanged() {
422 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); 422 search_box_->SelectSelectionModel(model_->search_box()->selection_model());
423 } 423 }
424 424
425 void SearchBoxView::TextChanged() { 425 void SearchBoxView::Update() {
426 search_box_->SetText(model_->search_box()->text()); 426 search_box_->SetText(model_->search_box()->text());
427 NotifyQueryChanged(); 427 NotifyQueryChanged();
428 } 428 }
429 429
430 void SearchBoxView::OnSpeechRecognitionStateChanged( 430 void SearchBoxView::OnSpeechRecognitionStateChanged(
431 SpeechRecognitionState new_state) { 431 SpeechRecognitionState new_state) {
432 SpeechRecognitionButtonPropChanged(); 432 SpeechRecognitionButtonPropChanged();
433 SchedulePaint(); 433 SchedulePaint();
434 } 434 }
435 435
436 } // namespace app_list 436 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/search_box_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698