| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/common/logging_chrome.h" | 50 #include "chrome/common/logging_chrome.h" |
| 51 #include "chrome/common/notification_service.h" | 51 #include "chrome/common/notification_service.h" |
| 52 #include "chrome/common/process_watcher.h" | 52 #include "chrome/common/process_watcher.h" |
| 53 #include "chrome/common/render_messages.h" | 53 #include "chrome/common/render_messages.h" |
| 54 #include "chrome/common/result_codes.h" | 54 #include "chrome/common/result_codes.h" |
| 55 #include "chrome/renderer/render_process.h" | 55 #include "chrome/renderer/render_process.h" |
| 56 #include "chrome/renderer/render_thread.h" | 56 #include "chrome/renderer/render_thread.h" |
| 57 #include "grit/generated_resources.h" | 57 #include "grit/generated_resources.h" |
| 58 #include "ipc/ipc_logging.h" | 58 #include "ipc/ipc_logging.h" |
| 59 #include "ipc/ipc_message.h" | 59 #include "ipc/ipc_message.h" |
| 60 #include "ipc/ipc_platform_file.h" | |
| 61 #include "ipc/ipc_switches.h" | 60 #include "ipc/ipc_switches.h" |
| 62 | 61 |
| 63 #if defined(OS_WIN) | 62 #if defined(OS_WIN) |
| 64 #include "app/win_util.h" | 63 #include "app/win_util.h" |
| 65 #include "chrome/browser/sandbox_policy.h" | 64 #include "chrome/browser/sandbox_policy.h" |
| 66 #elif defined(OS_LINUX) | 65 #elif defined(OS_LINUX) |
| 67 #include "base/singleton.h" | 66 #include "base/singleton.h" |
| 68 #include "chrome/browser/crash_handler_host_linux.h" | 67 #include "chrome/browser/crash_handler_host_linux.h" |
| 69 #include "chrome/browser/zygote_host_linux.h" | 68 #include "chrome/browser/zygote_host_linux.h" |
| 70 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h" | 69 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h" |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 } | 1129 } |
| 1131 | 1130 |
| 1132 void BrowserRenderProcessHost::AddSpellCheckWord(const std::string& word) { | 1131 void BrowserRenderProcessHost::AddSpellCheckWord(const std::string& word) { |
| 1133 Send(new ViewMsg_SpellChecker_WordAdded(word)); | 1132 Send(new ViewMsg_SpellChecker_WordAdded(word)); |
| 1134 } | 1133 } |
| 1135 | 1134 |
| 1136 void BrowserRenderProcessHost::InitSpellChecker() { | 1135 void BrowserRenderProcessHost::InitSpellChecker() { |
| 1137 SpellCheckHost* spellcheck_host = profile()->GetSpellCheckHost(); | 1136 SpellCheckHost* spellcheck_host = profile()->GetSpellCheckHost(); |
| 1138 if (spellcheck_host) { | 1137 if (spellcheck_host) { |
| 1139 PrefService* prefs = profile()->GetPrefs(); | 1138 PrefService* prefs = profile()->GetPrefs(); |
| 1140 IPC::PlatformFileForTransit file; | |
| 1141 #if defined(OS_POSIX) | |
| 1142 file = base::FileDescriptor(spellcheck_host->bdict_file(), false); | |
| 1143 #elif defined(OS_WIN) | |
| 1144 ::DuplicateHandle(::GetCurrentProcess(), spellcheck_host->bdict_file(), | |
| 1145 GetHandle(), &file, 0, false, DUPLICATE_SAME_ACCESS); | |
| 1146 #endif | |
| 1147 Send(new ViewMsg_SpellChecker_Init( | 1139 Send(new ViewMsg_SpellChecker_Init( |
| 1148 file, | 1140 spellcheck_host->bdict_fd(), spellcheck_host->custom_words(), |
| 1149 spellcheck_host->custom_words(), | |
| 1150 spellcheck_host->language(), | 1141 spellcheck_host->language(), |
| 1151 prefs->GetBoolean(prefs::kEnableAutoSpellCorrect))); | 1142 prefs->GetBoolean(prefs::kEnableAutoSpellCorrect))); |
| 1152 } else { | 1143 } else { |
| 1153 Send(new ViewMsg_SpellChecker_Init( | 1144 Send(new ViewMsg_SpellChecker_Init( |
| 1154 IPC::PlatformFileForTransit(), | 1145 base::FileDescriptor(), std::vector<std::string>(), std::string(), |
| 1155 std::vector<std::string>(), | |
| 1156 std::string(), | |
| 1157 false)); | 1146 false)); |
| 1158 } | 1147 } |
| 1159 } | 1148 } |
| 1160 | 1149 |
| 1161 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { | 1150 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { |
| 1162 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); | 1151 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); |
| 1163 } | 1152 } |
| 1164 #endif | 1153 #endif |
| OLD | NEW |