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

Unified Diff: chrome/browser/spellchecker/spellcheck_host_impl.h

Issue 8432027: NOT FOR REVIEW: quick hacks for http://codereview.chromium.org/7919003/ Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_host.cc ('k') | chrome/browser/spellchecker/spellcheck_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker/spellcheck_host_impl.h
===================================================================
--- chrome/browser/spellchecker/spellcheck_host_impl.h (revision 108048)
+++ chrome/browser/spellchecker/spellcheck_host_impl.h (working copy)
@@ -9,8 +9,10 @@
#include <string>
#include <vector>
+#include "base/compiler_specific.h"
#include "base/file_path.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/spellchecker/spellcheck_host.h"
#include "chrome/browser/spellchecker/spellcheck_profile_provider.h"
#include "content/public/common/url_fetcher_delegate.h"
@@ -46,15 +48,17 @@
net::URLRequestContextGetter* request_context_getter,
SpellCheckHostMetrics* metrics);
+ virtual ~SpellCheckHostImpl();
+
void Initialize();
// SpellCheckHost implementation
- virtual void UnsetProfile();
- virtual void InitForRenderer(RenderProcessHost* process);
- virtual void AddWord(const std::string& word);
- virtual const base::PlatformFile& GetDictionaryFile() const;
- virtual const std::string& GetLanguage() const;
- virtual bool IsUsingPlatformChecker() const;
+ virtual void UnsetProfile() OVERRIDE;
+ virtual void InitForRenderer(RenderProcessHost* process) OVERRIDE;
+ virtual void AddWord(const std::string& word) OVERRIDE;
+ virtual const base::PlatformFile& GetDictionaryFile() const OVERRIDE;
+ virtual const std::string& GetLanguage() const OVERRIDE;
+ virtual bool IsUsingPlatformChecker() const OVERRIDE;
private:
typedef SpellCheckProfileProvider::CustomWordList CustomWordList;
@@ -63,8 +67,6 @@
friend class BrowserThread;
friend class DeleteTask<SpellCheckHostImpl>;
- virtual ~SpellCheckHostImpl();
-
// Figure out the location for the dictionary. This is only non-trivial for
// Windows:
// The default place whether the spellcheck dictionary can reside is
@@ -72,13 +74,10 @@
// this directory may not have permissions for download. In that case, the
// alternate directory for download is chrome::DIR_USER_DATA.
void InitializeDictionaryLocation();
+ void InitializeDictionaryLocationComplete();
- // Load and parse the custom words dictionary and open the bdic file.
- // Executed on the file thread.
- void InitializeInternal();
+ void AddWordComplete(const std::string& word);
- void InitializeOnFileThread();
-
// Inform |profile_| that initialization has finished.
// |custom_words| holds the custom word list which was
// loaded at the file thread.
@@ -159,6 +158,10 @@
// An optional metrics counter given by the constructor.
SpellCheckHostMetrics* metrics_;
+ base::WeakPtrFactory<SpellCheckHostImpl> weak_ptr_factory_;
+
+ scoped_ptr<CustomWordList> custom_words_;
+
DISALLOW_COPY_AND_ASSIGN(SpellCheckHostImpl);
};
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_host.cc ('k') | chrome/browser/spellchecker/spellcheck_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698