diff options
5 files changed, 20 insertions, 3 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index e8707b3..bc454bc 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -75,6 +75,7 @@ #include "chrome/browser/view_type_utils.h" #include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_process_policy.h" @@ -1745,6 +1746,12 @@ bool ChromeContentBrowserClient::AllowPepperPrivateFileAPI() { switches::kPpapiFlashInProcess); } +FilePath ChromeContentBrowserClient::GetHyphenDictionaryDirectory() { + FilePath directory; + PathService::Get(chrome::DIR_APP_DICTIONARIES, &directory); + return directory.Append(FILE_PATH_LITERAL("Hyphen")); +} + #if defined(OS_POSIX) && !defined(OS_MACOSX) void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( const CommandLine& command_line, diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 4a17eb6..3c042c9 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -203,6 +203,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { virtual bool AllowPepperSocketAPI(content::BrowserContext* browser_context, const GURL& url) OVERRIDE; virtual bool AllowPepperPrivateFileAPI() OVERRIDE; + virtual FilePath GetHyphenDictionaryDirectory() OVERRIDE; #if defined(OS_POSIX) && !defined(OS_MACOSX) virtual void GetAdditionalMappedFilesForChildProcess( diff --git a/content/browser/hyphenator/hyphenator_message_filter.cc b/content/browser/hyphenator/hyphenator_message_filter.cc index b8e13ab..2132f76 100644 --- a/content/browser/hyphenator/hyphenator_message_filter.cc +++ b/content/browser/hyphenator/hyphenator_message_filter.cc @@ -10,8 +10,8 @@ #include "content/browser/hyphenator/hyphenator_message_filter.h" #include "content/common/hyphenator_messages.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_process_host.h" -#include "content/public/common/content_paths.h" namespace { @@ -85,8 +85,10 @@ void HyphenatorMessageFilter::OnOpenDictionary(const string16& locale) { void HyphenatorMessageFilter::OpenDictionary(const string16& locale) { DCHECK(dictionary_file_ == base::kInvalidPlatformFileValue); - if (dictionary_base_.empty()) - PathService::Get(base::DIR_EXE, &dictionary_base_); + if (dictionary_base_.empty()) { + dictionary_base_ = + GetContentClient()->browser()->GetHyphenDictionaryDirectory(); + } std::string rule_file = locale.empty() ? "en-US" : UTF16ToASCII(locale); rule_file.append("-1-0.dic"); FilePath rule_path = dictionary_base_.AppendASCII(rule_file); diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index 79f9f00..bc27f44 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc @@ -241,6 +241,10 @@ bool ContentBrowserClient::AllowPepperPrivateFileAPI() { return false; } +FilePath ContentBrowserClient::GetHyphenDictionaryDirectory() { + return FilePath(); +} + #if defined(OS_WIN) const wchar_t* ContentBrowserClient::GetResourceDllName() { return NULL; diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 7c55235..a861b70 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -449,6 +449,9 @@ class CONTENT_EXPORT ContentBrowserClient { // Returns true if renderer processes can use private Pepper File APIs. virtual bool AllowPepperPrivateFileAPI(); + // Returns the directory containing hyphenation dictionaries. + virtual FilePath GetHyphenDictionaryDirectory(); + #if defined(OS_POSIX) && !defined(OS_MACOSX) // Populates |mappings| with all files that need to be mapped before launching // a child process. |