OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
968 // Only consider keeping non-app URLs in an app process if this window | 968 // Only consider keeping non-app URLs in an app process if this window |
969 // has an opener (in which case it might be an OAuth popup that tries to | 969 // has an opener (in which case it might be an OAuth popup that tries to |
970 // script an iframe within the app). | 970 // script an iframe within the app). |
971 bool should_consider_workaround = !!frame->opener(); | 971 bool should_consider_workaround = !!frame->opener(); |
972 | 972 |
973 return extensions::CrossesExtensionProcessBoundary( | 973 return extensions::CrossesExtensionProcessBoundary( |
974 extensions, ExtensionURLInfo(old_url), ExtensionURLInfo(new_url), | 974 extensions, ExtensionURLInfo(old_url), ExtensionURLInfo(new_url), |
975 should_consider_workaround); | 975 should_consider_workaround); |
976 } | 976 } |
977 | 977 |
978 void ChromeContentRendererClient::SetSpellcheck(SpellCheck* spellcheck) { | |
979 RenderThread* thread = RenderThread::Get(); | |
980 if (spellcheck_.get() && thread) | |
981 thread->RemoveObserver(spellcheck_.get()); | |
982 spellcheck_.reset(spellcheck); | |
983 SpellCheckReplacer replacer(spellcheck_.get()); | |
984 content::RenderView::ForEach(&replacer); | |
985 if (thread) | |
986 thread->AddObserver(spellcheck_.get()); | |
987 } | |
988 | |
sky
2012/11/12 03:51:37
nit: remove one line.
groby-ooo-7-16
2012/11/13 02:05:15
Done.
| |
989 | |
978 void ChromeContentRendererClient::OnPurgeMemory() { | 990 void ChromeContentRendererClient::OnPurgeMemory() { |
979 DVLOG(1) << "Resetting spellcheck in renderer client"; | 991 DVLOG(1) << "Resetting spellcheck in renderer client"; |
980 RenderThread* thread = RenderThread::Get(); | 992 SetSpellcheck(new SpellCheck()); |
981 if (spellcheck_.get()) | |
982 thread->RemoveObserver(spellcheck_.get()); | |
983 spellcheck_.reset(new SpellCheck()); | |
984 SpellCheckReplacer replacer(spellcheck_.get()); | |
985 content::RenderView::ForEach(&replacer); | |
986 thread->AddObserver(spellcheck_.get()); | |
987 } | 993 } |
988 | 994 |
989 bool ChromeContentRendererClient::IsAdblockInstalled() { | 995 bool ChromeContentRendererClient::IsAdblockInstalled() { |
990 return extension_dispatcher_->extensions()->Contains( | 996 return extension_dispatcher_->extensions()->Contains( |
991 "gighmmpiobklfepjocnamgkkbiglidom"); | 997 "gighmmpiobklfepjocnamgkkbiglidom"); |
992 } | 998 } |
993 | 999 |
994 bool ChromeContentRendererClient::IsAdblockPlusInstalled() { | 1000 bool ChromeContentRendererClient::IsAdblockPlusInstalled() { |
995 return extension_dispatcher_->extensions()->Contains( | 1001 return extension_dispatcher_->extensions()->Contains( |
996 "cfhdojbkjhnklbpkdaibdccddilifddb"); | 1002 "cfhdojbkjhnklbpkdaibdccddilifddb"); |
(...skipping 10 matching lines...) Expand all Loading... | |
1007 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 1013 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
1008 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 1014 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
1009 } | 1015 } |
1010 | 1016 |
1011 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 1017 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
1012 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 1018 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
1013 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 1019 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
1014 } | 1020 } |
1015 | 1021 |
1016 } // namespace chrome | 1022 } // namespace chrome |
OLD | NEW |