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

Side by Side Diff: chrome/browser/ui/app_list/search/search_controller.cc

Issue 149753002: Enables the 'hotword not listening' icon in the search box. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix breaks Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app_list/search/search_controller.h" 5 #include "chrome/browser/ui/app_list/search/search_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 SearchController::~SearchController() {} 54 SearchController::~SearchController() {}
55 55
56 void SearchController::Init() { 56 void SearchController::Init() {
57 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 57 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
58 search_box_->SetHintText( 58 search_box_->SetHintText(
59 l10n_util::GetStringUTF16(IDS_SEARCH_BOX_HINT)); 59 l10n_util::GetStringUTF16(IDS_SEARCH_BOX_HINT));
60 search_box_->SetIcon(*bundle.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)); 60 search_box_->SetIcon(*bundle.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH));
61 StartPageService* service = StartPageService::Get(profile_); 61 StartPageService* service = StartPageService::Get(profile_);
62 if (service && service->GetSpeechRecognitionContents()) { 62 if (service && service->GetSpeechRecognitionContents()) {
63 search_box_->SetSpeechRecognitionButton( 63 search_box_->SetSpeechRecognitionButton(
64 scoped_ptr<SearchBoxModel::ButtonProperty>( 64 scoped_ptr<SearchBoxModel::SpeechButtonProperty>(
65 new SearchBoxModel::ButtonProperty( 65 new SearchBoxModel::SpeechButtonProperty(
66 *bundle.GetImageSkiaNamed(IDR_OMNIBOX_MIC_SEARCH), 66 *bundle.GetImageSkiaNamed(IDR_OMNIBOX_MIC_SEARCH),
67 l10n_util::GetStringUTF16( 67 l10n_util::GetStringUTF16(
68 IDS_APP_LIST_HOTWORD_LISTENING),
69 *bundle.GetImageSkiaNamed(IDR_APP_LIST_MIC_HOTWORD_OFF),
70 l10n_util::GetStringUTF16(
68 IDS_APP_LIST_START_SPEECH_RECOGNITION)))); 71 IDS_APP_LIST_START_SPEECH_RECOGNITION))));
69 } 72 }
70 73
71 mixer_->Init(); 74 mixer_->Init();
72 75
73 AddProvider(Mixer::MAIN_GROUP, scoped_ptr<SearchProvider>( 76 AddProvider(Mixer::MAIN_GROUP, scoped_ptr<SearchProvider>(
74 new AppSearchProvider(profile_, list_controller_)).Pass()); 77 new AppSearchProvider(profile_, list_controller_)).Pass());
75 AddProvider(Mixer::OMNIBOX_GROUP, scoped_ptr<SearchProvider>( 78 AddProvider(Mixer::OMNIBOX_GROUP, scoped_ptr<SearchProvider>(
76 new OmniboxProvider(profile_)).Pass()); 79 new OmniboxProvider(profile_)).Pass());
77 AddProvider(Mixer::WEBSTORE_GROUP, scoped_ptr<SearchProvider>( 80 AddProvider(Mixer::WEBSTORE_GROUP, scoped_ptr<SearchProvider>(
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 KnownResults known_results; 161 KnownResults known_results;
159 if (history_ && history_->IsReady()) { 162 if (history_ && history_->IsReady()) {
160 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text())) 163 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text()))
161 ->swap(known_results); 164 ->swap(known_results);
162 } 165 }
163 166
164 mixer_->MixAndPublish(known_results); 167 mixer_->MixAndPublish(known_results);
165 } 168 }
166 169
167 } // namespace app_list 170 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.cc ('k') | chrome/browser/ui/webui/app_list/start_page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698