| 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 3345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3356 NotifyNavigationStateChanged(changed_flags); | 3356 NotifyNavigationStateChanged(changed_flags); |
| 3357 } | 3357 } |
| 3358 | 3358 |
| 3359 void WebContentsImpl::DidStartNavigationToPendingEntry(const GURL& url, | 3359 void WebContentsImpl::DidStartNavigationToPendingEntry(const GURL& url, |
| 3360 ReloadType reload_type) { | 3360 ReloadType reload_type) { |
| 3361 // Notify observers about navigation. | 3361 // Notify observers about navigation. |
| 3362 for (auto& observer : observers_) | 3362 for (auto& observer : observers_) |
| 3363 observer.DidStartNavigationToPendingEntry(url, reload_type); | 3363 observer.DidStartNavigationToPendingEntry(url, reload_type); |
| 3364 } | 3364 } |
| 3365 | 3365 |
| 3366 void WebContentsImpl::RequestOpenURL(RenderFrameHostImpl* render_frame_host, | 3366 void WebContentsImpl::RequestOpenURL(RenderFrameHost* render_frame_host, |
| 3367 const OpenURLParams& params) { | 3367 const OpenURLParams& params) { |
| 3368 // OpenURL can blow away the source RFH. Use the process/frame routing ID as a | 3368 // OpenURL can blow away the source RFH. Use the process/frame routing ID as a |
| 3369 // weak pointer of sorts. | 3369 // weak pointer of sorts. |
| 3370 const int32_t process_id = render_frame_host->GetProcess()->GetID(); | 3370 const int32_t process_id = render_frame_host->GetProcess()->GetID(); |
| 3371 const int32_t frame_id = render_frame_host->GetRoutingID(); | 3371 const int32_t frame_id = render_frame_host->GetRoutingID(); |
| 3372 | 3372 |
| 3373 WebContents* new_contents = OpenURL(params); | 3373 WebContents* new_contents = OpenURL(params); |
| 3374 | 3374 |
| 3375 if (new_contents && RenderFrameHost::FromID(process_id, frame_id)) { | 3375 if (new_contents && RenderFrameHost::FromID(process_id, frame_id)) { |
| 3376 // Notify observers. | 3376 // Notify observers. |
| 3377 for (auto& observer : observers_) { | 3377 for (auto& observer : observers_) { |
| 3378 observer.DidOpenRequestedURL(new_contents, render_frame_host, params.url, | 3378 observer.DidOpenRequestedURL(new_contents, render_frame_host, params.url, |
| 3379 params.referrer, params.disposition, | 3379 params.referrer, params.disposition, |
| 3380 params.transition); | 3380 params.transition, |
| 3381 params.started_from_context_menu); |
| 3381 } | 3382 } |
| 3382 } | 3383 } |
| 3383 } | 3384 } |
| 3384 | 3385 |
| 3385 bool WebContentsImpl::ShouldTransferNavigation(bool is_main_frame_navigation) { | 3386 bool WebContentsImpl::ShouldTransferNavigation(bool is_main_frame_navigation) { |
| 3386 if (!delegate_) | 3387 if (!delegate_) |
| 3387 return true; | 3388 return true; |
| 3388 return delegate_->ShouldTransferNavigation(is_main_frame_navigation); | 3389 return delegate_->ShouldTransferNavigation(is_main_frame_navigation); |
| 3389 } | 3390 } |
| 3390 | 3391 |
| (...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5396 GetMainFrame()->AddMessageToConsole( | 5397 GetMainFrame()->AddMessageToConsole( |
| 5397 content::CONSOLE_MESSAGE_LEVEL_WARNING, | 5398 content::CONSOLE_MESSAGE_LEVEL_WARNING, |
| 5398 base::StringPrintf("This site does not have a valid SSL " | 5399 base::StringPrintf("This site does not have a valid SSL " |
| 5399 "certificate! Without SSL, your site's and " | 5400 "certificate! Without SSL, your site's and " |
| 5400 "visitors' data is vulnerable to theft and " | 5401 "visitors' data is vulnerable to theft and " |
| 5401 "tampering. Get a valid SSL certificate before" | 5402 "tampering. Get a valid SSL certificate before" |
| 5402 " releasing your website to the public.")); | 5403 " releasing your website to the public.")); |
| 5403 } | 5404 } |
| 5404 | 5405 |
| 5405 } // namespace content | 5406 } // namespace content |
| OLD | NEW |