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/browser/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 | 618 |
619 // When using --site-per-process, we notify the RFHM for all navigations, | 619 // When using --site-per-process, we notify the RFHM for all navigations, |
620 // not just main frame navigations. | 620 // not just main frame navigations. |
621 if (oopifs_possible) { | 621 if (oopifs_possible) { |
622 FrameTreeNode* frame = render_frame_host->frame_tree_node(); | 622 FrameTreeNode* frame = render_frame_host->frame_tree_node(); |
623 frame->render_manager()->DidNavigateFrame( | 623 frame->render_manager()->DidNavigateFrame( |
624 render_frame_host, params.gesture == NavigationGestureUser); | 624 render_frame_host, params.gesture == NavigationGestureUser); |
625 } | 625 } |
626 | 626 |
627 // Update the site of the SiteInstance if it doesn't have one yet, unless | 627 // Update the site of the SiteInstance if it doesn't have one yet, unless |
628 // assigning a site is not necessary for this URL. In that case, the | 628 // assigning a site is not necessary for this URL or the commit was for an |
629 // SiteInstance can still be considered unused until a navigation to a real | 629 // error page. In that case, the SiteInstance can still be considered unused |
630 // page. | 630 // until a navigation to a real page. |
631 SiteInstanceImpl* site_instance = render_frame_host->GetSiteInstance(); | 631 SiteInstanceImpl* site_instance = render_frame_host->GetSiteInstance(); |
632 if (!site_instance->HasSite() && | 632 if (!site_instance->HasSite() && ShouldAssignSiteForURL(params.url) && |
633 ShouldAssignSiteForURL(params.url)) { | 633 !params.url_is_unreachable) { |
634 site_instance->SetSite(params.url); | 634 site_instance->SetSite(params.url); |
635 } | 635 } |
636 | 636 |
637 // Need to update MIME type here because it's referred to in | 637 // Need to update MIME type here because it's referred to in |
638 // UpdateNavigationCommands() called by RendererDidNavigate() to | 638 // UpdateNavigationCommands() called by RendererDidNavigate() to |
639 // determine whether or not to enable the encoding menu. | 639 // determine whether or not to enable the encoding menu. |
640 // It's updated only for the main frame. For a subframe, | 640 // It's updated only for the main frame. For a subframe, |
641 // RenderView::UpdateURL does not set params.contents_mime_type. | 641 // RenderView::UpdateURL does not set params.contents_mime_type. |
642 // (see http://code.google.com/p/chromium/issues/detail?id=2929 ) | 642 // (see http://code.google.com/p/chromium/issues/detail?id=2929 ) |
643 // TODO(jungshik): Add a test for the encoding menu to avoid | 643 // TODO(jungshik): Add a test for the encoding menu to avoid |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 if (navigation_handle) | 1287 if (navigation_handle) |
1288 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); | 1288 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); |
1289 | 1289 |
1290 controller_->SetPendingEntry(std::move(entry)); | 1290 controller_->SetPendingEntry(std::move(entry)); |
1291 if (delegate_) | 1291 if (delegate_) |
1292 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1292 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
1293 } | 1293 } |
1294 } | 1294 } |
1295 | 1295 |
1296 } // namespace content | 1296 } // namespace content |
OLD | NEW |