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

Side by Side Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 69813002: Adds the speech recognition button to the app-list searchbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/start_page_service.h" 5 #include "chrome/browser/ui/app_list/start_page_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 StartPageService::~StartPageService() {} 142 StartPageService::~StartPageService() {}
143 143
144 void StartPageService::AddObserver(StartPageObserver* observer) { 144 void StartPageService::AddObserver(StartPageObserver* observer) {
145 observers_.AddObserver(observer); 145 observers_.AddObserver(observer);
146 } 146 }
147 147
148 void StartPageService::RemoveObserver(StartPageObserver* observer) { 148 void StartPageService::RemoveObserver(StartPageObserver* observer) {
149 observers_.RemoveObserver(observer); 149 observers_.RemoveObserver(observer);
150 } 150 }
151 151
152 void StartPageService::ToggleSpeechRecognition() {
153 contents_->GetWebUI()->CallJavascriptFunction(
154 "appList.startPage.toggleSpeechRecognition");
155 }
156
152 void StartPageService::OnSearch(const base::string16& query) { 157 void StartPageService::OnSearch(const base::string16& query) {
153 FOR_EACH_OBSERVER(StartPageObserver, observers_, OnSearch(query)); 158 FOR_EACH_OBSERVER(StartPageObserver, observers_, OnSearch(query));
154 } 159 }
155 160
161 void StartPageService::OnSpeechRecognitionStateChanged(bool recognizing) {
162 FOR_EACH_OBSERVER(StartPageObserver,
163 observers_,
164 OnSpeechRecognitionStateChanged(recognizing));
165 }
166
156 void StartPageService::Shutdown() { 167 void StartPageService::Shutdown() {
157 contents_.reset(); 168 contents_.reset();
158 } 169 }
159 170
160 } // namespace app_list 171 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698