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 #ifndef CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
18 #include "chrome/browser/ui/app_list/speech_recognizer_delegate.h" | 18 #include "chrome/browser/ui/app_list/speech_recognizer_delegate.h" |
19 #include "components/keyed_service/core/keyed_service.h" | 19 #include "components/keyed_service/core/keyed_service.h" |
20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
21 #include "ui/app_list/speech_ui_model_observer.h" | 21 #include "ui/app_list/speech_ui_model_observer.h" |
22 | 22 |
23 #if defined(OS_CHROMEOS) | |
24 #include "chromeos/audio/cras_audio_handler.h" | |
tapted
2014/11/26 02:05:59
move this to cc file?
Jun Mukai
2014/11/26 23:29:51
Done.
| |
25 #endif | |
26 | |
23 namespace extensions { | 27 namespace extensions { |
24 class Extension; | 28 class Extension; |
25 } | 29 } |
26 | 30 |
27 class Profile; | 31 class Profile; |
28 | 32 |
29 namespace app_list { | 33 namespace app_list { |
30 | 34 |
31 class RecommendedApps; | 35 class RecommendedApps; |
32 class SpeechRecognizer; | 36 class SpeechRecognizer; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 | 85 |
82 // ProfileDestroyObserver to shutdown the service on exiting. WebContents | 86 // ProfileDestroyObserver to shutdown the service on exiting. WebContents |
83 // depends on the profile and needs to be closed before the profile and its | 87 // depends on the profile and needs to be closed before the profile and its |
84 // keyed service shutdown. | 88 // keyed service shutdown. |
85 class ProfileDestroyObserver; | 89 class ProfileDestroyObserver; |
86 | 90 |
87 // The WebContentsDelegate implementation for the start page. This allows | 91 // The WebContentsDelegate implementation for the start page. This allows |
88 // getUserMedia() request from the web contents. | 92 // getUserMedia() request from the web contents. |
89 class StartPageWebContentsDelegate; | 93 class StartPageWebContentsDelegate; |
90 | 94 |
95 #if defined(OS_CHROMEOS) | |
96 // This class observes the change of audio input device availability and | |
97 // checks if currently the system has valid audio input. | |
98 class AudioStatus; | |
99 #endif | |
100 | |
91 void LoadContents(); | 101 void LoadContents(); |
92 void UnloadContents(); | 102 void UnloadContents(); |
93 | 103 |
94 // KeyedService overrides: | 104 // KeyedService overrides: |
95 void Shutdown() override; | 105 void Shutdown() override; |
96 | 106 |
97 Profile* profile_; | 107 Profile* profile_; |
98 scoped_ptr<content::WebContents> contents_; | 108 scoped_ptr<content::WebContents> contents_; |
99 scoped_ptr<StartPageWebContentsDelegate> contents_delegate_; | 109 scoped_ptr<StartPageWebContentsDelegate> contents_delegate_; |
100 scoped_ptr<ProfileDestroyObserver> profile_destroy_observer_; | 110 scoped_ptr<ProfileDestroyObserver> profile_destroy_observer_; |
101 scoped_ptr<RecommendedApps> recommended_apps_; | 111 scoped_ptr<RecommendedApps> recommended_apps_; |
102 SpeechRecognitionState state_; | 112 SpeechRecognitionState state_; |
103 ObserverList<StartPageObserver> observers_; | 113 ObserverList<StartPageObserver> observers_; |
104 bool speech_button_toggled_manually_; | 114 bool speech_button_toggled_manually_; |
105 bool speech_result_obtained_; | 115 bool speech_result_obtained_; |
106 | 116 |
107 bool webui_finished_loading_; | 117 bool webui_finished_loading_; |
108 std::vector<base::Closure> pending_webui_callbacks_; | 118 std::vector<base::Closure> pending_webui_callbacks_; |
109 | 119 |
110 scoped_ptr<SpeechRecognizer> speech_recognizer_; | 120 scoped_ptr<SpeechRecognizer> speech_recognizer_; |
111 | 121 |
122 #if defined(OS_CHROMEOS) | |
123 scoped_ptr<AudioStatus> audio_status_; | |
124 #endif | |
125 | |
112 base::WeakPtrFactory<StartPageService> weak_factory_; | 126 base::WeakPtrFactory<StartPageService> weak_factory_; |
113 | 127 |
114 DISALLOW_COPY_AND_ASSIGN(StartPageService); | 128 DISALLOW_COPY_AND_ASSIGN(StartPageService); |
115 }; | 129 }; |
116 | 130 |
117 } // namespace app_list | 131 } // namespace app_list |
118 | 132 |
119 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ | 133 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ |
OLD | NEW |