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

Side by Side Diff: chrome/browser/speech/speech_input_extension_api.h

Issue 8508051: Revert 109285 - Seems to have broken chrome_frame_net_tests on the win_rel trybot, stuffing up th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SPEECH_SPEECH_INPUT_EXTENSION_API_H_
6 #define CHROME_BROWSER_SPEECH_SPEECH_INPUT_EXTENSION_API_H_
7 #pragma once
8
9 #include "chrome/browser/extensions/extension_function.h"
10 #include "content/public/browser/notification_observer.h"
11
12 class SpeechInputExtensionManager;
13
14 // Handles asynchronous operations such as starting or stopping speech
15 // recognition in the framework of the extension API state machine.
16 class SpeechInputAsyncFunction : public AsyncExtensionFunction,
17 public content::NotificationObserver {
18 protected:
19 SpeechInputAsyncFunction(int start_state, int transition_state,
20 int end_state, int transition_notification);
21 virtual ~SpeechInputAsyncFunction();
22
23 virtual void Run() OVERRIDE;
24 virtual bool RunImpl() = 0;
25
26 private:
27 // content::NotificationObserver.
28 virtual void Observe(int type,
29 const content::NotificationSource& source,
30 const content::NotificationDetails& details) OVERRIDE;
31
32 // To be defined on construction by derived classes.
33 int start_state_;
34 int transition_state_;
35 int end_state_;
36 int transition_notification_;
37
38 content::NotificationRegistrar registrar_;
39 bool expecting_transition_;
40 bool failed_;
41 };
42
43 // Implements experimental.speechInput.start.
44 class StartSpeechInputFunction : public SpeechInputAsyncFunction {
45 public:
46 StartSpeechInputFunction();
47 virtual ~StartSpeechInputFunction() {}
48
49 protected:
50 virtual bool RunImpl() OVERRIDE;
51 DECLARE_EXTENSION_FUNCTION_NAME("experimental.speechInput.start");
52 };
53
54 // Implements experimental.speechInput.stop.
55 class StopSpeechInputFunction : public SpeechInputAsyncFunction {
56 public:
57 StopSpeechInputFunction();
58 virtual ~StopSpeechInputFunction() {}
59
60 protected:
61 virtual bool RunImpl() OVERRIDE;
62 DECLARE_EXTENSION_FUNCTION_NAME("experimental.speechInput.stop");
63 };
64
65 // Implements experimental.speechInput.isRecording.
66 class IsRecordingSpeechInputFunction : public SyncExtensionFunction {
67 protected:
68 virtual bool RunImpl() OVERRIDE;
69 DECLARE_EXTENSION_FUNCTION_NAME("experimental.speechInput.isRecording");
70 };
71
72 #endif // CHROME_BROWSER_SPEECH_SPEECH_INPUT_EXTENSION_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_dependency_manager.cc ('k') | chrome/browser/speech/speech_input_extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698