| 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 | 551 |
| 552 bool ChromeContentRendererClient::CrossesExtensionExtents(WebFrame* frame, | 552 bool ChromeContentRendererClient::CrossesExtensionExtents(WebFrame* frame, |
| 553 const GURL& new_url) { | 553 const GURL& new_url) { |
| 554 const ExtensionSet* extensions = extension_dispatcher_->extensions(); | 554 const ExtensionSet* extensions = extension_dispatcher_->extensions(); |
| 555 // If the URL is still empty, this is a window.open navigation. Check the | 555 // If the URL is still empty, this is a window.open navigation. Check the |
| 556 // opener's URL. | 556 // opener's URL. |
| 557 GURL old_url(frame->url()); | 557 GURL old_url(frame->url()); |
| 558 if (old_url.is_empty() && frame->opener()) | 558 if (old_url.is_empty() && frame->opener()) |
| 559 old_url = frame->opener()->url(); | 559 old_url = frame->opener()->url(); |
| 560 | 560 |
| 561 // If this is a reload, check whether it has the wrong process type. We |
| 562 // should send it to the browser if it's an extension URL (e.g., hosted app) |
| 563 // in a normal process, or if it's a process for an extension that has been |
| 564 // uninstalled. |
| 565 if (old_url == new_url) { |
| 566 bool is_extension_url = !!extensions->GetByURL(new_url); |
| 567 if (is_extension_url != extension_dispatcher_->is_extension_process()) |
| 568 return true; |
| 569 } |
| 570 |
| 561 return !extensions->InSameExtent(old_url, new_url); | 571 return !extensions->InSameExtent(old_url, new_url); |
| 562 } | 572 } |
| 563 | 573 |
| 564 } // namespace chrome | 574 } // namespace chrome |
| OLD | NEW |