OLD | NEW |
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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 contents_->GetWebUI()->CallJavascriptFunction( | 334 contents_->GetWebUI()->CallJavascriptFunction( |
335 "appList.startPage.onAppListHidden"); | 335 "appList.startPage.onAppListHidden"); |
336 } | 336 } |
337 if (!app_list::switches::IsExperimentalAppListEnabled()) | 337 if (!app_list::switches::IsExperimentalAppListEnabled()) |
338 UnloadContents(); | 338 UnloadContents(); |
339 | 339 |
340 if (HotwordService::IsExperimentalHotwordingEnabled() && | 340 if (HotwordService::IsExperimentalHotwordingEnabled() && |
341 speech_recognizer_) { | 341 speech_recognizer_) { |
342 speech_recognizer_->Stop(); | 342 speech_recognizer_->Stop(); |
343 speech_recognizer_.reset(); | 343 speech_recognizer_.reset(); |
| 344 |
| 345 // When the SpeechRecognizer is destroyed above, we get stuck in the current |
| 346 // speech state instead of being reset into the READY state. Reset the |
| 347 // speech state explicitly so that speech works when the launcher is opened |
| 348 // again. |
| 349 OnSpeechRecognitionStateChanged(SPEECH_RECOGNITION_READY); |
344 } | 350 } |
345 | 351 |
346 #if defined(OS_CHROMEOS) | 352 #if defined(OS_CHROMEOS) |
347 audio_status_.reset(); | 353 audio_status_.reset(); |
348 #endif | 354 #endif |
349 } | 355 } |
350 | 356 |
351 void StartPageService::ToggleSpeechRecognition( | 357 void StartPageService::ToggleSpeechRecognition( |
352 const scoped_refptr<content::SpeechRecognitionSessionPreamble>& preamble) { | 358 const scoped_refptr<content::SpeechRecognitionSessionPreamble>& preamble) { |
353 DCHECK(contents_); | 359 DCHECK(contents_); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 | 615 |
610 // Check for a new doodle. | 616 // Check for a new doodle. |
611 content::BrowserThread::PostDelayedTask( | 617 content::BrowserThread::PostDelayedTask( |
612 content::BrowserThread::UI, FROM_HERE, | 618 content::BrowserThread::UI, FROM_HERE, |
613 base::Bind(&StartPageService::FetchDoodleJson, | 619 base::Bind(&StartPageService::FetchDoodleJson, |
614 weak_factory_.GetWeakPtr()), | 620 weak_factory_.GetWeakPtr()), |
615 recheck_delay); | 621 recheck_delay); |
616 } | 622 } |
617 | 623 |
618 } // namespace app_list | 624 } // namespace app_list |
OLD | NEW |