OLD | NEW |
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 #ifndef CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_PREFERENCES_H_ | 5 #ifndef CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_PREFERENCES_H_ |
6 #define CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_PREFERENCES_H_ | 6 #define CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_PREFERENCES_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 private: | 72 private: |
73 friend struct DefaultSingletonTraits<Factory>; | 73 friend struct DefaultSingletonTraits<Factory>; |
74 | 74 |
75 Factory(); | 75 Factory(); |
76 virtual ~Factory(); | 76 virtual ~Factory(); |
77 | 77 |
78 // ProfileKeyedServiceFactory methods: | 78 // ProfileKeyedServiceFactory methods: |
79 virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile) | 79 virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile) |
80 const OVERRIDE; | 80 const OVERRIDE; |
81 virtual void RegisterUserPrefs(PrefService* prefs) OVERRIDE; | 81 virtual void RegisterUserPrefs(PrefService* prefs) OVERRIDE; |
82 virtual bool ServiceRedirectedInIncognito() OVERRIDE { return false; } | 82 virtual bool ServiceRedirectedInIncognito() OVERRIDE; |
83 virtual bool ServiceIsNULLWhileTesting() OVERRIDE { return true; } | 83 virtual bool ServiceIsNULLWhileTesting() OVERRIDE; |
84 virtual bool ServiceIsCreatedWithProfile() OVERRIDE { return false; } | 84 virtual bool ServiceIsCreatedWithProfile() OVERRIDE; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(Factory); | 86 DISALLOW_COPY_AND_ASSIGN(Factory); |
87 }; | 87 }; |
88 | 88 |
89 // This wrapper handles the binding between ChromeSpeechRecognitionPreferences | 89 // This wrapper handles the binding between ChromeSpeechRecognitionPreferences |
90 // instances (which can have a longer lifetime, since they are refcounted) and | 90 // instances (which can have a longer lifetime, since they are refcounted) and |
91 // ProfileKeyedService (which lifetime depends on the Profile service). Upon | 91 // ProfileKeyedService (which lifetime depends on the Profile service). Upon |
92 // profile shutdown, the ChromeSpeechRecognitionPreferences instance is | 92 // profile shutdown, the ChromeSpeechRecognitionPreferences instance is |
93 // detached from profile, meaning that after that point its clients can still | 93 // detached from profile, meaning that after that point its clients can still |
94 // use it, but preferences will no longer be kept in sync with the profile. | 94 // use it, but preferences will no longer be kept in sync with the profile. |
(...skipping 25 matching lines...) Expand all Loading... |
120 scoped_ptr<base::ListValue> notifications_shown_; | 120 scoped_ptr<base::ListValue> notifications_shown_; |
121 | 121 |
122 // Lock used to ensure exclusive access to preference variables that are | 122 // Lock used to ensure exclusive access to preference variables that are |
123 // accessed by both threads (note: mutable is required to keep getters const). | 123 // accessed by both threads (note: mutable is required to keep getters const). |
124 mutable base::Lock preferences_lock_; | 124 mutable base::Lock preferences_lock_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(ChromeSpeechRecognitionPreferences); | 126 DISALLOW_COPY_AND_ASSIGN(ChromeSpeechRecognitionPreferences); |
127 }; | 127 }; |
128 | 128 |
129 #endif // CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_PREFERENCES_H_ | 129 #endif // CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_PREFERENCES_H_ |
OLD | NEW |