Chromium Code Reviews| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 726 // In all other cases, we want to compare against the top frame's URL (as | 726 // In all other cases, we want to compare against the top frame's URL (as |
| 727 // opposed to the opener frame's), since that's what determines the type of | 727 // opposed to the opener frame's), since that's what determines the type of |
| 728 // process. This allows iframes outside an app to open a popup in the app. | 728 // process. This allows iframes outside an app to open a popup in the app. |
| 729 old_url = frame->top()->opener()->top()->document().url(); | 729 old_url = frame->top()->opener()->top()->document().url(); |
| 730 } | 730 } |
| 731 | 731 |
| 732 // Determine if the old URL is an extension (excluding bookmark apps). | 732 // Determine if the old URL is an extension (excluding bookmark apps). |
| 733 const Extension* old_url_extension = GetNonBookmarkAppExtension(extensions, | 733 const Extension* old_url_extension = GetNonBookmarkAppExtension(extensions, |
| 734 old_url); | 734 old_url); |
| 735 | 735 |
| 736 // TODO(creis): Temporary workaround for crbug.com/59285: Only return true if | 736 // TODO(supersat): Make sure this change is correct |
|
Charlie Reis
2011/12/01 23:13:02
Yes, this is what I intended.
supersat
2011/12/09 23:08:20
Done.
| |
| 737 // we would enter an extension app's extent from a non-app, or if we leave an | 737 return old_url_extension != new_url_extension; |
| 738 // extension with no web extent. We avoid swapping processes to exit a hosted | |
| 739 // app for now, since we do not yet support postMessage calls from outside the | |
| 740 // app back into it (e.g., as in Facebook OAuth 2.0). | |
| 741 bool old_url_is_hosted_app = old_url_extension && | |
| 742 !old_url_extension->web_extent().is_empty(); | |
| 743 if (old_url_is_hosted_app) | |
| 744 return false; | |
| 745 | 738 |
| 746 return old_url_extension != new_url_extension; | |
| 747 } | 739 } |
| 748 | 740 |
| 749 void ChromeContentRendererClient::OnPurgeMemory() { | 741 void ChromeContentRendererClient::OnPurgeMemory() { |
| 750 DVLOG(1) << "Resetting spellcheck in renderer client"; | 742 DVLOG(1) << "Resetting spellcheck in renderer client"; |
| 751 RenderThread* thread = RenderThread::Get(); | 743 RenderThread* thread = RenderThread::Get(); |
| 752 if (spellcheck_.get()) | 744 if (spellcheck_.get()) |
| 753 thread->RemoveObserver(spellcheck_.get()); | 745 thread->RemoveObserver(spellcheck_.get()); |
| 754 SpellCheck* new_spellcheck = new SpellCheck(); | 746 SpellCheck* new_spellcheck = new SpellCheck(); |
| 755 if (spellcheck_provider_) | 747 if (spellcheck_provider_) |
| 756 spellcheck_provider_->SetSpellCheck(new_spellcheck); | 748 spellcheck_provider_->SetSpellCheck(new_spellcheck); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 779 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 771 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
| 780 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 772 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
| 781 } | 773 } |
| 782 | 774 |
| 783 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 775 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
| 784 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 776 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
| 785 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 777 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
| 786 } | 778 } |
| 787 | 779 |
| 788 } // namespace chrome | 780 } // namespace chrome |
| OLD | NEW |