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

Side by Side Diff: chrome/browser/speech/tts_mac.mm

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 months 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
« no previous file with comments | « chrome/browser/speech/tts_linux.cc ('k') | chrome/browser/speech/tts_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <string> 5 #include <string>
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 TtsPlatformImplMac(); 82 TtsPlatformImplMac();
83 ~TtsPlatformImplMac() override; 83 ~TtsPlatformImplMac() override;
84 84
85 base::scoped_nsobject<SingleUseSpeechSynthesizer> speech_synthesizer_; 85 base::scoped_nsobject<SingleUseSpeechSynthesizer> speech_synthesizer_;
86 base::scoped_nsobject<ChromeTtsDelegate> delegate_; 86 base::scoped_nsobject<ChromeTtsDelegate> delegate_;
87 int utterance_id_; 87 int utterance_id_;
88 std::string utterance_; 88 std::string utterance_;
89 int last_char_index_; 89 int last_char_index_;
90 bool paused_; 90 bool paused_;
91 91
92 friend struct DefaultSingletonTraits<TtsPlatformImplMac>; 92 friend struct base::DefaultSingletonTraits<TtsPlatformImplMac>;
93 93
94 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplMac); 94 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplMac);
95 }; 95 };
96 96
97 // static 97 // static
98 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { 98 TtsPlatformImpl* TtsPlatformImpl::GetInstance() {
99 return TtsPlatformImplMac::GetInstance(); 99 return TtsPlatformImplMac::GetInstance();
100 } 100 }
101 101
102 bool TtsPlatformImplMac::Speak( 102 bool TtsPlatformImplMac::Speak(
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 paused_ = false; 282 paused_ = false;
283 283
284 delegate_.reset([[ChromeTtsDelegate alloc] initWithPlatformImplMac:this]); 284 delegate_.reset([[ChromeTtsDelegate alloc] initWithPlatformImplMac:this]);
285 } 285 }
286 286
287 TtsPlatformImplMac::~TtsPlatformImplMac() { 287 TtsPlatformImplMac::~TtsPlatformImplMac() {
288 } 288 }
289 289
290 // static 290 // static
291 TtsPlatformImplMac* TtsPlatformImplMac::GetInstance() { 291 TtsPlatformImplMac* TtsPlatformImplMac::GetInstance() {
292 return Singleton<TtsPlatformImplMac>::get(); 292 return base::Singleton<TtsPlatformImplMac>::get();
293 } 293 }
294 294
295 @implementation ChromeTtsDelegate 295 @implementation ChromeTtsDelegate
296 296
297 - (id)initWithPlatformImplMac:(TtsPlatformImplMac*)ttsImplMac { 297 - (id)initWithPlatformImplMac:(TtsPlatformImplMac*)ttsImplMac {
298 if ((self = [super init])) { 298 if ((self = [super init])) {
299 ttsImplMac_ = ttsImplMac; 299 ttsImplMac_ = ttsImplMac;
300 } 300 }
301 return self; 301 return self;
302 } 302 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 didSpeak_ = true; 341 didSpeak_ = true;
342 return [super startSpeakingString:utterance_]; 342 return [super startSpeakingString:utterance_];
343 } 343 }
344 344
345 - (bool)startSpeakingString:(NSString*)utterance { 345 - (bool)startSpeakingString:(NSString*)utterance {
346 CHECK(false); 346 CHECK(false);
347 return false; 347 return false;
348 } 348 }
349 349
350 @end 350 @end
OLDNEW
« no previous file with comments | « chrome/browser/speech/tts_linux.cc ('k') | chrome/browser/speech/tts_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698