OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 bool ChromeContentRendererClient::ShouldPumpEventsDuringCookieMessage() { | 622 bool ChromeContentRendererClient::ShouldPumpEventsDuringCookieMessage() { |
623 // We only need to pump events for chrome frame processes as the | 623 // We only need to pump events for chrome frame processes as the |
624 // cookie policy is controlled by the host browser (IE). If the | 624 // cookie policy is controlled by the host browser (IE). If the |
625 // policy is set to prompt then the host would put up UI which | 625 // policy is set to prompt then the host would put up UI which |
626 // would require plugins if any to also pump to ensure that we | 626 // would require plugins if any to also pump to ensure that we |
627 // don't have a deadlock. | 627 // don't have a deadlock. |
628 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame); | 628 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame); |
629 } | 629 } |
630 | 630 |
631 void ChromeContentRendererClient::DidCreateScriptContext(WebFrame* frame) { | 631 void ChromeContentRendererClient::DidCreateScriptContext(WebFrame* frame) { |
632 EventBindings::HandleContextCreated( | 632 EventBindings::HandleContextCreated(frame, |
633 frame, false, extension_dispatcher_.get()); | 633 frame->mainWorldScriptContext(), |
| 634 extension_dispatcher_.get(), |
| 635 0); // isolated world ID |
634 } | 636 } |
635 | 637 |
636 void ChromeContentRendererClient::DidDestroyScriptContext(WebFrame* frame) { | 638 void ChromeContentRendererClient::DidDestroyScriptContext(WebFrame* frame) { |
637 EventBindings::HandleContextDestroyed(frame); | 639 EventBindings::HandleContextDestroyed(frame); |
638 } | 640 } |
639 | 641 |
640 void ChromeContentRendererClient::DidCreateIsolatedScriptContext( | 642 void ChromeContentRendererClient::DidCreateIsolatedScriptContext( |
641 WebFrame* frame) { | 643 WebFrame* frame, int world_id, v8::Handle<v8::Context> context) { |
642 EventBindings::HandleContextCreated(frame, true, extension_dispatcher_.get()); | 644 EventBindings::HandleContextCreated(frame, |
| 645 context, |
| 646 extension_dispatcher_.get(), |
| 647 world_id); |
643 } | 648 } |
644 | 649 |
645 unsigned long long ChromeContentRendererClient::VisitedLinkHash( | 650 unsigned long long ChromeContentRendererClient::VisitedLinkHash( |
646 const char* canonical_url, size_t length) { | 651 const char* canonical_url, size_t length) { |
647 return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); | 652 return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); |
648 } | 653 } |
649 | 654 |
650 bool ChromeContentRendererClient::IsLinkVisited(unsigned long long link_hash) { | 655 bool ChromeContentRendererClient::IsLinkVisited(unsigned long long link_hash) { |
651 return visited_link_slave_->IsVisited(link_hash); | 656 return visited_link_slave_->IsVisited(link_hash); |
652 } | 657 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 if (spellcheck_.get()) | 708 if (spellcheck_.get()) |
704 thread->RemoveObserver(spellcheck_.get()); | 709 thread->RemoveObserver(spellcheck_.get()); |
705 SpellCheck* new_spellcheck = new SpellCheck(); | 710 SpellCheck* new_spellcheck = new SpellCheck(); |
706 if (spellcheck_provider_) | 711 if (spellcheck_provider_) |
707 spellcheck_provider_->SetSpellCheck(new_spellcheck); | 712 spellcheck_provider_->SetSpellCheck(new_spellcheck); |
708 spellcheck_.reset(new_spellcheck); | 713 spellcheck_.reset(new_spellcheck); |
709 thread->AddObserver(new_spellcheck); | 714 thread->AddObserver(new_spellcheck); |
710 } | 715 } |
711 | 716 |
712 } // namespace chrome | 717 } // namespace chrome |
OLD | NEW |