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 #include "chrome/renderer/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
6 | 6 |
7 #include <v8.h> | 7 #include <v8.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "chrome/renderer/render_process.h" | 51 #include "chrome/renderer/render_process.h" |
52 #include "chrome/renderer/render_view.h" | 52 #include "chrome/renderer/render_view.h" |
53 #include "chrome/renderer/renderer_webkitclient_impl.h" | 53 #include "chrome/renderer/renderer_webkitclient_impl.h" |
54 #include "chrome/renderer/renderer_web_database_observer.h" | 54 #include "chrome/renderer/renderer_web_database_observer.h" |
55 #include "chrome/renderer/socket_stream_dispatcher.h" | 55 #include "chrome/renderer/socket_stream_dispatcher.h" |
56 #if defined(SPELLCHECKER_IN_RENDERER) | 56 #if defined(SPELLCHECKER_IN_RENDERER) |
57 #include "chrome/renderer/spellchecker/spellcheck.h" | 57 #include "chrome/renderer/spellchecker/spellcheck.h" |
58 #endif | 58 #endif |
59 #include "chrome/renderer/user_script_slave.h" | 59 #include "chrome/renderer/user_script_slave.h" |
60 #include "ipc/ipc_message.h" | 60 #include "ipc/ipc_message.h" |
61 #include "ipc/ipc_platform_file.h" | |
62 #include "third_party/tcmalloc/tcmalloc/src/google/malloc_extension.h" | 61 #include "third_party/tcmalloc/tcmalloc/src/google/malloc_extension.h" |
63 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" | 62 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" |
64 #include "third_party/WebKit/WebKit/chromium/public/WebColor.h" | 63 #include "third_party/WebKit/WebKit/chromium/public/WebColor.h" |
65 #include "third_party/WebKit/WebKit/chromium/public/WebCrossOriginPreflightResul
tCache.h" | 64 #include "third_party/WebKit/WebKit/chromium/public/WebCrossOriginPreflightResul
tCache.h" |
66 #include "third_party/WebKit/WebKit/chromium/public/WebDatabase.h" | 65 #include "third_party/WebKit/WebKit/chromium/public/WebDatabase.h" |
67 #include "third_party/WebKit/WebKit/chromium/public/WebFontCache.h" | 66 #include "third_party/WebKit/WebKit/chromium/public/WebFontCache.h" |
68 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 67 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
69 #include "third_party/WebKit/WebKit/chromium/public/WebRuntimeFeatures.h" | 68 #include "third_party/WebKit/WebKit/chromium/public/WebRuntimeFeatures.h" |
70 #include "third_party/WebKit/WebKit/chromium/public/WebScriptController.h" | 69 #include "third_party/WebKit/WebKit/chromium/public/WebScriptController.h" |
71 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityPolicy.h" | 70 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityPolicy.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 // point we already know that the browser has refreshed its list, so disable | 653 // point we already know that the browser has refreshed its list, so disable |
655 // refresh temporarily to prevent each renderer process causing the list to be | 654 // refresh temporarily to prevent each renderer process causing the list to be |
656 // regenerated. | 655 // regenerated. |
657 plugin_refresh_allowed_ = false; | 656 plugin_refresh_allowed_ = false; |
658 WebKit::resetPluginCache(reload_pages); | 657 WebKit::resetPluginCache(reload_pages); |
659 plugin_refresh_allowed_ = true; | 658 plugin_refresh_allowed_ = true; |
660 } | 659 } |
661 | 660 |
662 #if defined(SPELLCHECKER_IN_RENDERER) | 661 #if defined(SPELLCHECKER_IN_RENDERER) |
663 void RenderThread::OnInitSpellChecker( | 662 void RenderThread::OnInitSpellChecker( |
664 IPC::PlatformFileForTransit bdict_file, | 663 const base::FileDescriptor& bdict_fd, |
665 const std::vector<std::string>& custom_words, | 664 const std::vector<std::string>& custom_words, |
666 const std::string& language, | 665 const std::string& language, |
667 bool auto_spell_correct) { | 666 bool auto_spell_correct) { |
668 spellchecker_->Init(IPC::PlatformFileForTransitToPlatformFile(bdict_file), | 667 spellchecker_->Init(bdict_fd, custom_words, language); |
669 custom_words, language); | |
670 spellchecker_->EnableAutoSpellCorrect(auto_spell_correct); | 668 spellchecker_->EnableAutoSpellCorrect(auto_spell_correct); |
671 } | 669 } |
672 | 670 |
673 void RenderThread::OnSpellCheckWordAdded(const std::string& word) { | 671 void RenderThread::OnSpellCheckWordAdded(const std::string& word) { |
674 spellchecker_->WordAdded(word); | 672 spellchecker_->WordAdded(word); |
675 } | 673 } |
676 | 674 |
677 void RenderThread::OnSpellCheckEnableAutoSpellCorrect(bool enable) { | 675 void RenderThread::OnSpellCheckEnableAutoSpellCorrect(bool enable) { |
678 spellchecker_->EnableAutoSpellCorrect(enable); | 676 spellchecker_->EnableAutoSpellCorrect(enable); |
679 } | 677 } |
680 #endif | 678 #endif |
OLD | NEW |