OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This class gathers state related to a single user profile. | 5 // This class gathers state related to a single user profile. |
6 | 6 |
7 #ifndef CHROME_BROWSER_PROFILE_H__ | 7 #ifndef CHROME_BROWSER_PROFILE_H__ |
8 #define CHROME_BROWSER_PROFILE_H__ | 8 #define CHROME_BROWSER_PROFILE_H__ |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Return whether 2 profiles are the same. 2 profiles are the same if they | 180 // Return whether 2 profiles are the same. 2 profiles are the same if they |
181 // represent the same profile. This can happen if there is pointer equality | 181 // represent the same profile. This can happen if there is pointer equality |
182 // or if one profile is the off the record version of another profile (or vice | 182 // or if one profile is the off the record version of another profile (or vice |
183 // versa). | 183 // versa). |
184 virtual bool IsSameProfile(Profile* profile) = 0; | 184 virtual bool IsSameProfile(Profile* profile) = 0; |
185 | 185 |
186 // Returns the time the profile was started. This is not the time the profile | 186 // Returns the time the profile was started. This is not the time the profile |
187 // was created, rather it is the time the user started chrome and logged into | 187 // was created, rather it is the time the user started chrome and logged into |
188 // this profile. For the single profile case, this corresponds to the time | 188 // this profile. For the single profile case, this corresponds to the time |
189 // the user started chrome. | 189 // the user started chrome. |
190 virtual Time GetStartTime() const = 0; | 190 virtual base::Time GetStartTime() const = 0; |
191 | 191 |
192 // Returns the TabRestoreService. This returns NULL when off the record. | 192 // Returns the TabRestoreService. This returns NULL when off the record. |
193 virtual TabRestoreService* GetTabRestoreService() = 0; | 193 virtual TabRestoreService* GetTabRestoreService() = 0; |
194 | 194 |
195 virtual void ResetTabRestoreService() = 0; | 195 virtual void ResetTabRestoreService() = 0; |
196 | 196 |
197 // Initializes the spellchecker. If the spellchecker already exsts, then | 197 // Initializes the spellchecker. If the spellchecker already exsts, then |
198 // it is released, and initialized again. This model makes sure that | 198 // it is released, and initialized again. This model makes sure that |
199 // spellchecker language can be changed without restarting the browser. | 199 // spellchecker language can be changed without restarting the browser. |
200 // NOTE: This is being currently called in the UI thread, which is OK as long | 200 // NOTE: This is being currently called in the UI thread, which is OK as long |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 virtual SessionService* GetSessionService(); | 246 virtual SessionService* GetSessionService(); |
247 virtual void ShutdownSessionService(); | 247 virtual void ShutdownSessionService(); |
248 virtual bool HasSessionService() const; | 248 virtual bool HasSessionService() const; |
249 virtual std::wstring GetName(); | 249 virtual std::wstring GetName(); |
250 virtual void SetName(const std::wstring& name); | 250 virtual void SetName(const std::wstring& name); |
251 virtual std::wstring GetID(); | 251 virtual std::wstring GetID(); |
252 virtual void SetID(const std::wstring& id); | 252 virtual void SetID(const std::wstring& id); |
253 virtual bool DidLastSessionExitCleanly(); | 253 virtual bool DidLastSessionExitCleanly(); |
254 virtual BookmarkModel* GetBookmarkModel(); | 254 virtual BookmarkModel* GetBookmarkModel(); |
255 virtual bool IsSameProfile(Profile* profile); | 255 virtual bool IsSameProfile(Profile* profile); |
256 virtual Time GetStartTime() const; | 256 virtual base::Time GetStartTime() const; |
257 virtual TabRestoreService* GetTabRestoreService(); | 257 virtual TabRestoreService* GetTabRestoreService(); |
258 virtual void ResetTabRestoreService(); | 258 virtual void ResetTabRestoreService(); |
259 virtual void InitializeSpellChecker(); | 259 virtual void InitializeSpellChecker(); |
260 virtual SpellChecker* GetSpellChecker(); | 260 virtual SpellChecker* GetSpellChecker(); |
261 virtual void MarkAsCleanShutdown(); | 261 virtual void MarkAsCleanShutdown(); |
262 #ifdef CHROME_PERSONALIZATION | 262 #ifdef CHROME_PERSONALIZATION |
263 virtual ProfilePersonalization* GetProfilePersonalization(); | 263 virtual ProfilePersonalization* GetProfilePersonalization(); |
264 #endif | 264 #endif |
265 | 265 |
266 private: | 266 private: |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 bool created_web_data_service_; | 301 bool created_web_data_service_; |
302 bool created_download_manager_; | 302 bool created_download_manager_; |
303 // Whether or not the last session exited cleanly. This is set only once. | 303 // Whether or not the last session exited cleanly. This is set only once. |
304 bool last_session_exited_cleanly_; | 304 bool last_session_exited_cleanly_; |
305 | 305 |
306 base::OneShotTimer<ProfileImpl> create_session_service_timer_; | 306 base::OneShotTimer<ProfileImpl> create_session_service_timer_; |
307 | 307 |
308 scoped_ptr<OffTheRecordProfileImpl> off_the_record_profile_; | 308 scoped_ptr<OffTheRecordProfileImpl> off_the_record_profile_; |
309 | 309 |
310 // See GetStartTime for details. | 310 // See GetStartTime for details. |
311 Time start_time_; | 311 base::Time start_time_; |
312 | 312 |
313 scoped_ptr<TabRestoreService> tab_restore_service_; | 313 scoped_ptr<TabRestoreService> tab_restore_service_; |
314 | 314 |
315 // This can not be a scoped_refptr because we must release it on the I/O | 315 // This can not be a scoped_refptr because we must release it on the I/O |
316 // thread. | 316 // thread. |
317 SpellChecker* spellchecker_; | 317 SpellChecker* spellchecker_; |
318 | 318 |
319 // Set to true when ShutdownSessionService is invoked. If true | 319 // Set to true when ShutdownSessionService is invoked. If true |
320 // GetSessionService won't recreate the SessionService. | 320 // GetSessionService won't recreate the SessionService. |
321 bool shutdown_session_service_; | 321 bool shutdown_session_service_; |
322 | 322 |
323 DISALLOW_EVIL_CONSTRUCTORS(ProfileImpl); | 323 DISALLOW_EVIL_CONSTRUCTORS(ProfileImpl); |
324 }; | 324 }; |
325 | 325 |
326 // This struct is used to pass the spellchecker object through the notification | 326 // This struct is used to pass the spellchecker object through the notification |
327 // NOTIFY_SPELLCHECKER_REINITIALIZED. This is used as the details for the | 327 // NOTIFY_SPELLCHECKER_REINITIALIZED. This is used as the details for the |
328 // notification service. | 328 // notification service. |
329 struct SpellcheckerReinitializedDetails { | 329 struct SpellcheckerReinitializedDetails { |
330 scoped_refptr<SpellChecker> spellchecker; | 330 scoped_refptr<SpellChecker> spellchecker; |
331 }; | 331 }; |
332 | 332 |
333 #endif // CHROME_BROWSER_PROFILE_H__ | 333 #endif // CHROME_BROWSER_PROFILE_H__ |
334 | 334 |
OLD | NEW |