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 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 // ProfileDestroyObserver to shutdown the service on exiting. WebContents | 82 // ProfileDestroyObserver to shutdown the service on exiting. WebContents |
83 // depends on the profile and needs to be closed before the profile and its | 83 // depends on the profile and needs to be closed before the profile and its |
84 // keyed service shutdown. | 84 // keyed service shutdown. |
85 class ProfileDestroyObserver; | 85 class ProfileDestroyObserver; |
86 | 86 |
87 // The WebContentsDelegate implementation for the start page. This allows | 87 // The WebContentsDelegate implementation for the start page. This allows |
88 // getUserMedia() request from the web contents. | 88 // getUserMedia() request from the web contents. |
89 class StartPageWebContentsDelegate; | 89 class StartPageWebContentsDelegate; |
90 | 90 |
91 #if defined(OS_CHROMEOS) | |
92 // This class observes the change of audio input device availability and | |
93 // checks if currently the system has valid audio input. | |
94 class AudioStatus; | |
95 #endif | |
96 | |
97 void LoadContents(); | 91 void LoadContents(); |
98 void UnloadContents(); | 92 void UnloadContents(); |
99 | 93 |
100 // KeyedService overrides: | 94 // KeyedService overrides: |
101 void Shutdown() override; | 95 void Shutdown() override; |
102 | 96 |
103 Profile* profile_; | 97 Profile* profile_; |
104 scoped_ptr<content::WebContents> contents_; | 98 scoped_ptr<content::WebContents> contents_; |
105 scoped_ptr<StartPageWebContentsDelegate> contents_delegate_; | 99 scoped_ptr<StartPageWebContentsDelegate> contents_delegate_; |
106 scoped_ptr<ProfileDestroyObserver> profile_destroy_observer_; | 100 scoped_ptr<ProfileDestroyObserver> profile_destroy_observer_; |
107 scoped_ptr<RecommendedApps> recommended_apps_; | 101 scoped_ptr<RecommendedApps> recommended_apps_; |
108 SpeechRecognitionState state_; | 102 SpeechRecognitionState state_; |
109 ObserverList<StartPageObserver> observers_; | 103 ObserverList<StartPageObserver> observers_; |
110 bool speech_button_toggled_manually_; | 104 bool speech_button_toggled_manually_; |
111 bool speech_result_obtained_; | 105 bool speech_result_obtained_; |
112 | 106 |
113 bool webui_finished_loading_; | 107 bool webui_finished_loading_; |
114 std::vector<base::Closure> pending_webui_callbacks_; | 108 std::vector<base::Closure> pending_webui_callbacks_; |
115 | 109 |
116 scoped_ptr<SpeechRecognizer> speech_recognizer_; | 110 scoped_ptr<SpeechRecognizer> speech_recognizer_; |
117 | 111 |
118 #if defined(OS_CHROMEOS) | |
119 scoped_ptr<AudioStatus> audio_status_; | |
120 #endif | |
121 | |
122 base::WeakPtrFactory<StartPageService> weak_factory_; | 112 base::WeakPtrFactory<StartPageService> weak_factory_; |
123 | 113 |
124 DISALLOW_COPY_AND_ASSIGN(StartPageService); | 114 DISALLOW_COPY_AND_ASSIGN(StartPageService); |
125 }; | 115 }; |
126 | 116 |
127 } // namespace app_list | 117 } // namespace app_list |
128 | 118 |
129 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ | 119 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ |
OLD | NEW |