| 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 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "chrome/browser/ui/app_list/speech_recognizer_delegate.h" | 22 #include "chrome/browser/ui/app_list/speech_recognizer_delegate.h" |
| 23 #include "components/keyed_service/core/keyed_service.h" | 23 #include "components/keyed_service/core/keyed_service.h" |
| 24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 25 #include "content/public/browser/web_contents_observer.h" | 25 #include "content/public/browser/web_contents_observer.h" |
| 26 #include "net/base/backoff_entry.h" | 26 #include "net/base/backoff_entry.h" |
| 27 #include "net/url_request/url_fetcher_delegate.h" | 27 #include "net/url_request/url_fetcher_delegate.h" |
| 28 #include "ui/app_list/speech_ui_model_observer.h" | 28 #include "ui/app_list/speech_ui_model_observer.h" |
| 29 | 29 |
| 30 namespace content { | 30 namespace content { |
| 31 struct FrameNavigateParams; | |
| 32 struct LoadCommittedDetails; | |
| 33 struct SpeechRecognitionSessionPreamble; | 31 struct SpeechRecognitionSessionPreamble; |
| 34 } | 32 } |
| 35 | 33 |
| 36 namespace extensions { | 34 namespace extensions { |
| 37 class Extension; | 35 class Extension; |
| 38 } | 36 } |
| 39 | 37 |
| 40 namespace net { | 38 namespace net { |
| 41 class URLFetcher; | 39 class URLFetcher; |
| 42 } | 40 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Fetch the Google Doodle JSON data and update the app list start page. | 135 // Fetch the Google Doodle JSON data and update the app list start page. |
| 138 void FetchDoodleJson(); | 136 void FetchDoodleJson(); |
| 139 | 137 |
| 140 // net::URLFetcherDelegate overrides: | 138 // net::URLFetcherDelegate overrides: |
| 141 void OnURLFetchComplete(const net::URLFetcher* source) override; | 139 void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 142 | 140 |
| 143 // KeyedService overrides: | 141 // KeyedService overrides: |
| 144 void Shutdown() override; | 142 void Shutdown() override; |
| 145 | 143 |
| 146 // contents::WebContentsObserver overrides; | 144 // contents::WebContentsObserver overrides; |
| 147 void DidNavigateMainFrame( | 145 void DidFinishNavigation( |
| 148 const content::LoadCommittedDetails& details, | 146 content::NavigationHandle* navigation_handle) override; |
| 149 const content::FrameNavigateParams& params) override; | |
| 150 void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host, | |
| 151 const GURL& validated_url, | |
| 152 int error_code, | |
| 153 const base::string16& error_description, | |
| 154 bool was_ignored_by_handler) override; | |
| 155 | 147 |
| 156 // Change the known microphone availability. |available| should be true if | 148 // Change the known microphone availability. |available| should be true if |
| 157 // the microphone exists and is available for use. | 149 // the microphone exists and is available for use. |
| 158 void OnMicrophoneChanged(bool available); | 150 void OnMicrophoneChanged(bool available); |
| 159 // Change the known network connectivity state. |available| should be true if | 151 // Change the known network connectivity state. |available| should be true if |
| 160 // at least one network is connected to. | 152 // at least one network is connected to. |
| 161 void OnNetworkChanged(bool available); | 153 void OnNetworkChanged(bool available); |
| 162 // Enables/disables voice recognition based on network and microphone state. | 154 // Enables/disables voice recognition based on network and microphone state. |
| 163 void UpdateRecognitionState(); | 155 void UpdateRecognitionState(); |
| 164 // Determines whether speech recognition should be enabled, based on the | 156 // Determines whether speech recognition should be enabled, based on the |
| (...skipping 28 matching lines...) Expand all Loading... |
| 193 net::BackoffEntry backoff_entry_; | 185 net::BackoffEntry backoff_entry_; |
| 194 | 186 |
| 195 base::WeakPtrFactory<StartPageService> weak_factory_; | 187 base::WeakPtrFactory<StartPageService> weak_factory_; |
| 196 | 188 |
| 197 DISALLOW_COPY_AND_ASSIGN(StartPageService); | 189 DISALLOW_COPY_AND_ASSIGN(StartPageService); |
| 198 }; | 190 }; |
| 199 | 191 |
| 200 } // namespace app_list | 192 } // namespace app_list |
| 201 | 193 |
| 202 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ | 194 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ |
| OLD | NEW |