summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.h
diff options
context:
space:
mode:
authorsidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 18:13:26 +0000
committersidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 18:13:26 +0000
commite7244d88820ab2a18760c14f12c4bdb060d72114 (patch)
treef4ce1cd6be60c8a41a52f0607aa4721238db0f91 /chrome/browser/profile.h
parent83b7bd304b48a7ec5f3532602c810bff6070e3d2 (diff)
downloadchromium_src-e7244d88820ab2a18760c14f12c4bdb060d72114.zip
chromium_src-e7244d88820ab2a18760c14f12c4bdb060d72114.tar.gz
chromium_src-e7244d88820ab2a18760c14f12c4bdb060d72114.tar.bz2
Add option to disable/enable Spell Check. In addition, remove additional code in resource message filter, which was initilaizing spellchecker in the filter if it was NULL. This part of the code is not required since the resource message filter should not initialize spellchecker; it is up to the profile to give the spellchecker to the resource message filter.
Issue = 120 Review URL: http://codereview.chromium.org/7935 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.h')
-rw-r--r--chrome/browser/profile.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h
index 2dbc055..cb3c2ac 100644
--- a/chrome/browser/profile.h
+++ b/chrome/browser/profile.h
@@ -18,6 +18,9 @@
#ifdef CHROME_PERSONALIZATION
#include "chrome/personalization/personalization.h"
#endif
+#include "chrome/common/notification_service.h"
+#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
class BookmarkModel;
class DownloadManager;
@@ -200,12 +203,9 @@ class Profile {
virtual void ResetTabRestoreService() = 0;
- // Initializes the spellchecker. If the spellchecker already exsts, then
- // it is released, and initialized again. This model makes sure that
- // spellchecker language can be changed without restarting the browser.
- // NOTE: This is being currently called in the UI thread, which is OK as long
- // as the spellchecker object is USED in the IO thread.
- virtual void InitializeSpellChecker() = 0;
+ // This reinitializes the spellchecker according to the current dictionary
+ // language, and enable spell check option, in the prefs.
+ virtual void ReinitializeSpellChecker() = 0;
// Returns the spell checker object for this profile. THIS OBJECT MUST ONLY
// BE USED ON THE I/O THREAD! This pointer is retrieved from the profile and
@@ -231,7 +231,8 @@ class Profile {
class OffTheRecordProfileImpl;
// The default profile implementation.
-class ProfileImpl : public Profile {
+class ProfileImpl : public Profile,
+ public NotificationObserver {
public:
virtual ~ProfileImpl();
@@ -263,12 +264,16 @@ class ProfileImpl : public Profile {
virtual base::Time GetStartTime() const;
virtual TabRestoreService* GetTabRestoreService();
virtual void ResetTabRestoreService();
- virtual void InitializeSpellChecker();
+ virtual void ReinitializeSpellChecker();
virtual SpellChecker* GetSpellChecker();
virtual void MarkAsCleanShutdown();
#ifdef CHROME_PERSONALIZATION
virtual ProfilePersonalization* GetProfilePersonalization();
#endif
+ // NotificationObserver implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
private:
class RequestContext;
@@ -286,6 +291,15 @@ class ProfileImpl : public Profile {
GetSessionService();
}
+ // Initializes the spellchecker. If the spellchecker already exsts, then
+ // it is released, and initialized again. This model makes sure that
+ // spellchecker language can be changed without restarting the browser.
+ // NOTE: This is being currently called in the UI thread, which is OK as long
+ // as the spellchecker object is USED in the IO thread.
+ // The |need_to_broadcast| parameter tells it whether to broadcast the new
+ // spellchecker to the resource message filters.
+ void InitializeSpellChecker(bool need_to_broadcast);
+
std::wstring path_;
bool off_the_record_;
scoped_ptr<VisitedLinkMaster> visited_link_master_;