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

Unified Diff: chrome/browser/spellcheck_host.h

Issue 397017: reland 31875. Revert was:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/renderer_host/browser_render_process_host.cc ('k') | chrome/browser/spellcheck_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellcheck_host.h
===================================================================
--- chrome/browser/spellcheck_host.h (revision 32089)
+++ chrome/browser/spellcheck_host.h (working copy)
@@ -8,8 +8,8 @@
#include <string>
#include <vector>
-#include "base/file_descriptor_posix.h"
#include "base/file_path.h"
+#include "base/platform_file.h"
#include "base/ref_counted.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/net/url_fetcher.h"
@@ -37,7 +37,7 @@
// update.
void AddWord(const std::string& word);
- const base::FileDescriptor& bdict_fd() const { return fd_; };
+ const base::PlatformFile& bdict_file() const { return file_; }
const std::vector<std::string>& custom_words() const { return custom_words_; }
@@ -52,6 +52,14 @@
virtual ~SpellCheckHost();
+ // Figure out the location for the dictionary. This is only non-trivial for
+ // Windows:
+ // The default place whether the spellcheck dictionary can reside is
+ // chrome::DIR_APP_DICTIONARIES. However, for systemwide installations,
+ // this directory may not have permissions for download. In that case, the
+ // alternate directory for download is chrome::DIR_USER_DATA.
+ void InitializeDictionaryLocation();
+
// Load and parse the custom words dictionary and open the bdic file.
// Executed on the file thread.
void InitializeInternal();
@@ -66,7 +74,7 @@
void WriteWordToCustomDictionary(const std::string& word);
// URLFetcher::Delegate implementation. Called when we finish downloading the
- // spellcheck dictionary; saves the dictionary to disk.
+ // spellcheck dictionary; saves the dictionary to |data_|.
virtual void OnURLFetchComplete(const URLFetcher* source,
const GURL& url,
const URLRequestStatus& status,
@@ -77,8 +85,8 @@
// May be NULL.
Observer* observer_;
- // The desired location of the dictionary file (whether or not it exists yet).
- FilePath bdict_file_;
+ // The desired location of the dictionary file (whether or not t exists yet).
+ FilePath bdict_file_path_;
// The location of the custom words file.
FilePath custom_dictionary_file_;
@@ -86,8 +94,8 @@
// The language of the dictionary file.
std::string language_;
- // On POSIX, the file descriptor for the dictionary file.
- base::FileDescriptor fd_;
+ // The file descriptor/handle for the dictionary file.
+ base::PlatformFile file_;
// In-memory cache of the custom words file.
std::vector<std::string> custom_words_;
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | chrome/browser/spellcheck_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698