OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 4961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4972 // blessed with file permissions. | 4972 // blessed with file permissions. |
4973 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); | 4973 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); |
4974 bool is_initial_navigation = render_view_->history_list_length_ == 0; | 4974 bool is_initial_navigation = render_view_->history_list_length_ == 0; |
4975 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || | 4975 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || |
4976 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || | 4976 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || |
4977 url.SchemeIs(kViewSourceScheme) || | 4977 url.SchemeIs(kViewSourceScheme) || |
4978 (frame_->isViewSourceModeEnabled() && | 4978 (frame_->isViewSourceModeEnabled() && |
4979 info.navigationType != blink::WebNavigationTypeReload); | 4979 info.navigationType != blink::WebNavigationTypeReload); |
4980 | 4980 |
4981 if (!should_fork && url.SchemeIs(url::kFileScheme)) { | 4981 if (!should_fork && url.SchemeIs(url::kFileScheme)) { |
4982 // Fork non-file to file opens. Check the opener URL if this is the | 4982 // Fork non-file to file opens. Note that this may fork unnecessarily if |
4983 // initial navigation in a newly opened window. | 4983 // another tab (hosting a file or not) targeted this one before its |
4984 GURL source_url(old_url); | 4984 // initial navigation, but that shouldn't cause a problem. |
4985 if (is_initial_navigation && source_url.is_empty() && frame_->opener()) | 4985 should_fork = !old_url.SchemeIs(url::kFileScheme); |
4986 source_url = frame_->opener()->top()->document().url(); | |
4987 DCHECK(!source_url.is_empty()); | |
4988 should_fork = !source_url.SchemeIs(url::kFileScheme); | |
4989 } | 4986 } |
4990 | 4987 |
4991 if (!should_fork) { | 4988 if (!should_fork) { |
4992 // Give the embedder a chance. | 4989 // Give the embedder a chance. |
4993 should_fork = GetContentClient()->renderer()->ShouldFork( | 4990 should_fork = GetContentClient()->renderer()->ShouldFork( |
4994 frame_, url, info.urlRequest.httpMethod().utf8(), | 4991 frame_, url, info.urlRequest.httpMethod().utf8(), |
4995 is_initial_navigation, is_redirect, &send_referrer); | 4992 is_initial_navigation, is_redirect, &send_referrer); |
4996 } | 4993 } |
4997 | 4994 |
4998 if (should_fork) { | 4995 if (should_fork) { |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6329 // event target. Potentially a Pepper plugin will receive the event. | 6326 // event target. Potentially a Pepper plugin will receive the event. |
6330 // In order to tell whether a plugin gets the last mouse event and which it | 6327 // In order to tell whether a plugin gets the last mouse event and which it |
6331 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6328 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6332 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6329 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6333 // |pepper_last_mouse_event_target_|. | 6330 // |pepper_last_mouse_event_target_|. |
6334 pepper_last_mouse_event_target_ = nullptr; | 6331 pepper_last_mouse_event_target_ = nullptr; |
6335 #endif | 6332 #endif |
6336 } | 6333 } |
6337 | 6334 |
6338 } // namespace content | 6335 } // namespace content |
OLD | NEW |