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

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

Issue 105773004: Introduces the speech recognition UI to app_list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: start_page existence Created 7 years 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 (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 "chrome/browser/ui/app_list/app_list_view_delegate.h" 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/ui/web_applications/web_app_ui.h" 28 #include "chrome/browser/ui/web_applications/web_app_ui.h"
29 #include "chrome/browser/web_applications/web_app.h" 29 #include "chrome/browser/web_applications/web_app.h"
30 #include "chrome/common/extensions/extension_constants.h" 30 #include "chrome/common/extensions/extension_constants.h"
31 #include "chrome/common/url_constants.h" 31 #include "chrome/common/url_constants.h"
32 #include "content/public/browser/browser_thread.h" 32 #include "content/public/browser/browser_thread.h"
33 #include "content/public/browser/notification_service.h" 33 #include "content/public/browser/notification_service.h"
34 #include "content/public/browser/notification_source.h" 34 #include "content/public/browser/notification_source.h"
35 #include "content/public/browser/page_navigator.h" 35 #include "content/public/browser/page_navigator.h"
36 #include "content/public/browser/user_metrics.h" 36 #include "content/public/browser/user_metrics.h"
37 #include "ui/app_list/search_box_model.h" 37 #include "ui/app_list/search_box_model.h"
38 #include "ui/app_list/speech_ui_model.h"
38 39
39 #if defined(USE_ASH) 40 #if defined(USE_ASH)
40 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" 41 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h"
41 #endif 42 #endif
42 43
43 #if defined(OS_WIN) 44 #if defined(OS_WIN)
44 #include "chrome/browser/web_applications/web_app_win.h" 45 #include "chrome/browser/web_applications/web_app_win.h"
45 #endif 46 #endif
46 47
47 namespace { 48 namespace {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 app_list::StartPageService::Get(profile_); 270 app_list::StartPageService::Get(profile_);
270 if (service) 271 if (service)
271 service->ToggleSpeechRecognition(); 272 service->ToggleSpeechRecognition();
272 } 273 }
273 274
274 void AppListViewDelegate::ShowForProfileByPath( 275 void AppListViewDelegate::ShowForProfileByPath(
275 const base::FilePath& profile_path) { 276 const base::FilePath& profile_path) {
276 controller_->ShowForProfileByPath(profile_path); 277 controller_->ShowForProfileByPath(profile_path);
277 } 278 }
278 279
279 void AppListViewDelegate::OnSearch(const base::string16& query) { 280 void AppListViewDelegate::OnSpeechResult(const base::string16& query,
280 model_->search_box()->SetText(query); 281 bool is_final) {
282 model_->speech_ui()->SetSpeechResult(query, is_final);
281 } 283 }
282 284
283 void AppListViewDelegate::OnSpeechRecognitionStateChanged(bool recognizing) { 285 void AppListViewDelegate::OnSpeechSoundLevelChanged(int16 level) {
284 model_->search_box()->SetSpeechRecognitionButtonState(recognizing); 286 model_->speech_ui()->UpdateSoundLevel(level);
287 }
288
289 void AppListViewDelegate::OnSpeechRecognitionStateChanged(
290 app_list::SpeechRecognitionState new_state) {
291 model_->speech_ui()->SetSpeechRecognitionState(new_state);
285 } 292 }
286 293
287 void AppListViewDelegate::Observe( 294 void AppListViewDelegate::Observe(
288 int type, 295 int type,
289 const content::NotificationSource& source, 296 const content::NotificationSource& source,
290 const content::NotificationDetails& details) { 297 const content::NotificationDetails& details) {
291 OnProfileChanged(); 298 OnProfileChanged();
292 } 299 }
293 300
294 void AppListViewDelegate::OnProfileAdded(const base::FilePath& profile_path) { 301 void AppListViewDelegate::OnProfileAdded(const base::FilePath& profile_path) {
(...skipping 17 matching lines...) Expand all
312 if (!service) 319 if (!service)
313 return NULL; 320 return NULL;
314 321
315 return service->contents(); 322 return service->contents();
316 } 323 }
317 324
318 const app_list::AppListViewDelegate::Users& 325 const app_list::AppListViewDelegate::Users&
319 AppListViewDelegate::GetUsers() const { 326 AppListViewDelegate::GetUsers() const {
320 return users_; 327 return users_;
321 } 328 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698