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

Side by Side Diff: content/public/test/fake_speech_recognition_manager.h

Issue 636863003: Make SpeechRecognition per RenderFrame instead of per RenderView. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes threading issues Created 6 years 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 CONTENT_PUBLIC_TEST_FAKE_SPEECH_RECOGNTION_MANAGER_H_ 5 #ifndef CONTENT_PUBLIC_TEST_FAKE_SPEECH_RECOGNTION_MANAGER_H_
6 #define CONTENT_PUBLIC_TEST_FAKE_SPEECH_RECOGNTION_MANAGER_H_ 6 #define CONTENT_PUBLIC_TEST_FAKE_SPEECH_RECOGNTION_MANAGER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "content/public/browser/speech_recognition_manager.h" 9 #include "content/public/browser/speech_recognition_manager.h"
10 #include "content/public/browser/speech_recognition_session_config.h" 10 #include "content/public/browser/speech_recognition_session_config.h"
(...skipping 28 matching lines...) Expand all
39 39
40 void WaitForRecognitionStarted(); 40 void WaitForRecognitionStarted();
41 41
42 void SetFakeResult(const std::string& result); 42 void SetFakeResult(const std::string& result);
43 43
44 // SpeechRecognitionManager methods. 44 // SpeechRecognitionManager methods.
45 int CreateSession(const SpeechRecognitionSessionConfig& config) override; 45 int CreateSession(const SpeechRecognitionSessionConfig& config) override;
46 void StartSession(int session_id) override; 46 void StartSession(int session_id) override;
47 void AbortSession(int session_id) override; 47 void AbortSession(int session_id) override;
48 void StopAudioCaptureForSession(int session_id) override; 48 void StopAudioCaptureForSession(int session_id) override;
49 void AbortAllSessionsForRenderProcess(int render_process_id) override; 49 void AbortAllSessionsForRenderFrame(int render_process_id,
50 void AbortAllSessionsForRenderView(int render_process_id, 50 int render_frame_id) override;
51 int render_view_id) override;
52 bool HasAudioInputDevices() override; 51 bool HasAudioInputDevices() override;
53 base::string16 GetAudioInputDeviceModel() override; 52 base::string16 GetAudioInputDeviceModel() override;
54 void ShowAudioInputSettings() override {} 53 void ShowAudioInputSettings() override {}
55 int GetSession(int render_process_id, 54 int GetSession(int render_process_id,
56 int render_view_id, 55 int render_frame_id,
57 int request_id) const override; 56 int request_id) const override;
58 const SpeechRecognitionSessionConfig& GetSessionConfig( 57 const SpeechRecognitionSessionConfig& GetSessionConfig(
59 int session_id) const override; 58 int session_id) const override;
60 SpeechRecognitionSessionContext GetSessionContext( 59 SpeechRecognitionSessionContext GetSessionContext(
61 int session_id) const override; 60 int session_id) const override;
62 61
63 private: 62 private:
64 void SetFakeRecognitionResult(); 63 void SetFakeRecognitionResult();
65 64
66 int session_id_; 65 int session_id_;
67 SpeechRecognitionEventListener* listener_; 66 SpeechRecognitionEventListener* listener_;
68 SpeechRecognitionSessionConfig session_config_; 67 SpeechRecognitionSessionConfig session_config_;
69 SpeechRecognitionSessionContext session_ctx_; 68 SpeechRecognitionSessionContext session_ctx_;
70 std::string fake_result_; 69 std::string fake_result_;
71 std::string grammar_; 70 std::string grammar_;
72 bool did_cancel_all_; 71 bool did_cancel_all_;
73 bool should_send_fake_response_; 72 bool should_send_fake_response_;
74 base::Closure recognition_started_closure_; 73 base::Closure recognition_started_closure_;
75 74
76 DISALLOW_COPY_AND_ASSIGN(FakeSpeechRecognitionManager); 75 DISALLOW_COPY_AND_ASSIGN(FakeSpeechRecognitionManager);
77 }; 76 };
78 77
79 } // namespace content 78 } // namespace content
80 79
81 #endif // CONTENT_PUBLIC_TEST_FAKE_SPEECH_RECOGNTION_MANAGER_H_ 80 #endif // CONTENT_PUBLIC_TEST_FAKE_SPEECH_RECOGNTION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698