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

Side by Side Diff: chrome/renderer/tts_dispatcher.h

Issue 63273002: Rename WebKit namespace to blink (part 4) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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 CHROME_RENDERER_TTS_DISPATCHER_H_ 5 #ifndef CHROME_RENDERER_TTS_DISPATCHER_H_
6 #define CHROME_RENDERER_TTS_DISPATCHER_H_ 6 #define CHROME_RENDERER_TTS_DISPATCHER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 10 matching lines...) Expand all
21 struct TtsVoice; 21 struct TtsVoice;
22 22
23 // TtsDispatcher is a delegate for methods used by Blink for speech synthesis 23 // TtsDispatcher is a delegate for methods used by Blink for speech synthesis
24 // APIs. It's the complement of TtsDispatcherHost (owned by RenderViewHost). 24 // APIs. It's the complement of TtsDispatcherHost (owned by RenderViewHost).
25 // Each TtsDispatcher is owned by the WebSpeechSynthesizerClient in Blink; 25 // Each TtsDispatcher is owned by the WebSpeechSynthesizerClient in Blink;
26 // it registers itself to listen to IPC upon construction and unregisters 26 // it registers itself to listen to IPC upon construction and unregisters
27 // itself when deleted. There can be multiple TtsDispatchers alive at once, 27 // itself when deleted. There can be multiple TtsDispatchers alive at once,
28 // so each one routes IPC messages to its WebSpeechSynthesizerClient only if 28 // so each one routes IPC messages to its WebSpeechSynthesizerClient only if
29 // the utterance id (which is globally unique) matches. 29 // the utterance id (which is globally unique) matches.
30 class TtsDispatcher 30 class TtsDispatcher
31 : public WebKit::WebSpeechSynthesizer, 31 : public blink::WebSpeechSynthesizer,
32 public content::RenderProcessObserver { 32 public content::RenderProcessObserver {
33 public: 33 public:
34 explicit TtsDispatcher(WebKit::WebSpeechSynthesizerClient* client); 34 explicit TtsDispatcher(blink::WebSpeechSynthesizerClient* client);
35 35
36 private: 36 private:
37 virtual ~TtsDispatcher(); 37 virtual ~TtsDispatcher();
38 38
39 // RenderProcessObserver override. 39 // RenderProcessObserver override.
40 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; 40 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
41 41
42 // WebKit::WebSpeechSynthesizer implementation. 42 // blink::WebSpeechSynthesizer implementation.
43 virtual void updateVoiceList() OVERRIDE; 43 virtual void updateVoiceList() OVERRIDE;
44 virtual void speak(const WebKit::WebSpeechSynthesisUtterance& utterance) 44 virtual void speak(const blink::WebSpeechSynthesisUtterance& utterance)
45 OVERRIDE; 45 OVERRIDE;
46 virtual void pause() OVERRIDE; 46 virtual void pause() OVERRIDE;
47 virtual void resume() OVERRIDE; 47 virtual void resume() OVERRIDE;
48 virtual void cancel() OVERRIDE; 48 virtual void cancel() OVERRIDE;
49 49
50 WebKit::WebSpeechSynthesisUtterance FindUtterance(int utterance_id); 50 blink::WebSpeechSynthesisUtterance FindUtterance(int utterance_id);
51 51
52 void OnSetVoiceList(const std::vector<TtsVoice>& voices); 52 void OnSetVoiceList(const std::vector<TtsVoice>& voices);
53 void OnDidStartSpeaking(int utterance_id); 53 void OnDidStartSpeaking(int utterance_id);
54 void OnDidFinishSpeaking(int utterance_id); 54 void OnDidFinishSpeaking(int utterance_id);
55 void OnDidPauseSpeaking(int utterance_id); 55 void OnDidPauseSpeaking(int utterance_id);
56 void OnDidResumeSpeaking(int utterance_id); 56 void OnDidResumeSpeaking(int utterance_id);
57 void OnWordBoundary(int utterance_id, int char_index); 57 void OnWordBoundary(int utterance_id, int char_index);
58 void OnSentenceBoundary(int utterance_id, int char_index); 58 void OnSentenceBoundary(int utterance_id, int char_index);
59 void OnMarkerEvent(int utterance_id, int char_index); 59 void OnMarkerEvent(int utterance_id, int char_index);
60 void OnWasInterrupted(int utterance_id); 60 void OnWasInterrupted(int utterance_id);
61 void OnWasCancelled(int utterance_id); 61 void OnWasCancelled(int utterance_id);
62 void OnSpeakingErrorOccurred(int utterance_id, 62 void OnSpeakingErrorOccurred(int utterance_id,
63 const std::string& error_message); 63 const std::string& error_message);
64 64
65 // The WebKit client class that we use to send events back to the JS world. 65 // The WebKit client class that we use to send events back to the JS world.
66 // Weak reference, this will be valid as long as this object exists. 66 // Weak reference, this will be valid as long as this object exists.
67 WebKit::WebSpeechSynthesizerClient* synthesizer_client_; 67 blink::WebSpeechSynthesizerClient* synthesizer_client_;
68 68
69 // Next utterance id, used to map response IPCs to utterance objects. 69 // Next utterance id, used to map response IPCs to utterance objects.
70 static int next_utterance_id_; 70 static int next_utterance_id_;
71 71
72 // Map from id to utterance objects. 72 // Map from id to utterance objects.
73 base::hash_map<int, WebKit::WebSpeechSynthesisUtterance> utterance_id_map_; 73 base::hash_map<int, blink::WebSpeechSynthesisUtterance> utterance_id_map_;
74 74
75 DISALLOW_COPY_AND_ASSIGN(TtsDispatcher); 75 DISALLOW_COPY_AND_ASSIGN(TtsDispatcher);
76 }; 76 };
77 77
78 #endif // CHROME_RENDERER_TTS_DISPATCHER_H_ 78 #endif // CHROME_RENDERER_TTS_DISPATCHER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/translate/translate_script_browsertest.cc ('k') | chrome/renderer/tts_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698