| 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 // When the opener is suppressed, the original renderer cannot access the | 2055 // When the opener is suppressed, the original renderer cannot access the |
| 2056 // new window. As a result, we need to show and navigate the window here. | 2056 // new window. As a result, we need to show and navigate the window here. |
| 2057 bool was_blocked = false; | 2057 bool was_blocked = false; |
| 2058 if (delegate_) { | 2058 if (delegate_) { |
| 2059 gfx::Rect initial_rect; | 2059 gfx::Rect initial_rect; |
| 2060 delegate_->AddNewContents( | 2060 delegate_->AddNewContents( |
| 2061 this, new_contents, params.disposition, initial_rect, | 2061 this, new_contents, params.disposition, initial_rect, |
| 2062 params.user_gesture, &was_blocked); | 2062 params.user_gesture, &was_blocked); |
| 2063 } | 2063 } |
| 2064 if (!was_blocked) { | 2064 if (!was_blocked) { |
| 2065 OpenURLParams open_params(params.target_url, | 2065 OpenURLParams open_params(params.target_url, params.referrer, CURRENT_TAB, |
| 2066 Referrer(), | |
| 2067 CURRENT_TAB, | |
| 2068 ui::PAGE_TRANSITION_LINK, | 2066 ui::PAGE_TRANSITION_LINK, |
| 2069 true /* is_renderer_initiated */); | 2067 true /* is_renderer_initiated */); |
| 2070 open_params.user_gesture = params.user_gesture; | 2068 open_params.user_gesture = params.user_gesture; |
| 2071 | 2069 |
| 2072 if (delegate_ && !is_guest && | 2070 if (delegate_ && !is_guest && |
| 2073 !delegate_->ShouldResumeRequestsForCreatedWindow()) { | 2071 !delegate_->ShouldResumeRequestsForCreatedWindow()) { |
| 2074 // We are in asynchronous add new contents path, delay opening url | 2072 // We are in asynchronous add new contents path, delay opening url |
| 2075 new_contents->delayed_open_url_params_.reset( | 2073 new_contents->delayed_open_url_params_.reset( |
| 2076 new OpenURLParams(open_params)); | 2074 new OpenURLParams(open_params)); |
| 2077 } else { | 2075 } else { |
| (...skipping 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5039 for (RenderViewHost* render_view_host : render_view_host_set) | 5037 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5040 render_view_host->OnWebkitPreferencesChanged(); | 5038 render_view_host->OnWebkitPreferencesChanged(); |
| 5041 } | 5039 } |
| 5042 | 5040 |
| 5043 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5041 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 5044 JavaScriptDialogManager* dialog_manager) { | 5042 JavaScriptDialogManager* dialog_manager) { |
| 5045 dialog_manager_ = dialog_manager; | 5043 dialog_manager_ = dialog_manager; |
| 5046 } | 5044 } |
| 5047 | 5045 |
| 5048 } // namespace content | 5046 } // namespace content |
| OLD | NEW |