| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 4913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4924 // This zoom level was merely recorded transiently for this load. We can | 4924 // This zoom level was merely recorded transiently for this load. We can |
| 4925 // erase it now. If at some point we reload this page, the browser will | 4925 // erase it now. If at some point we reload this page, the browser will |
| 4926 // send us a new, up-to-date zoom level. | 4926 // send us a new, up-to-date zoom level. |
| 4927 host_zoom_levels_.erase(host_zoom); | 4927 host_zoom_levels_.erase(host_zoom); |
| 4928 } | 4928 } |
| 4929 | 4929 |
| 4930 // Update contents MIME type for main frame. | 4930 // Update contents MIME type for main frame. |
| 4931 params.contents_mime_type = ds->GetResponse().MimeType().Utf8(); | 4931 params.contents_mime_type = ds->GetResponse().MimeType().Utf8(); |
| 4932 | 4932 |
| 4933 params.transition = navigation_state->GetTransitionType(); | 4933 params.transition = navigation_state->GetTransitionType(); |
| 4934 if (!ui::PageTransitionIsMainFrame(params.transition)) { | 4934 DCHECK(ui::PageTransitionIsMainFrame(params.transition)); |
| 4935 // If the main frame does a load, it should not be reported as a subframe | |
| 4936 // navigation. This can occur in the following case: | |
| 4937 // 1. You're on a site with frames. | |
| 4938 // 2. You do a subframe navigation. This is stored with transition type | |
| 4939 // MANUAL_SUBFRAME. | |
| 4940 // 3. You navigate to some non-frame site, say, google.com. | |
| 4941 // 4. You navigate back to the page from step 2. Since it was initially | |
| 4942 // MANUAL_SUBFRAME, it will be that same transition type here. | |
| 4943 // We don't want that, because any navigation that changes the toplevel | |
| 4944 // frame should be tracked as a toplevel navigation (this allows us to | |
| 4945 // update the URL bar, etc). | |
| 4946 params.transition = ui::PAGE_TRANSITION_LINK; | |
| 4947 } | |
| 4948 | 4935 |
| 4949 // If the page contained a client redirect (meta refresh, document.loc...), | 4936 // If the page contained a client redirect (meta refresh, document.loc...), |
| 4950 // set the transition appropriately. | 4937 // set the transition appropriately. |
| 4951 if (ds->IsClientRedirect()) { | 4938 if (ds->IsClientRedirect()) { |
| 4952 params.transition = ui::PageTransitionFromInt( | 4939 params.transition = ui::PageTransitionFromInt( |
| 4953 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT); | 4940 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT); |
| 4954 } | 4941 } |
| 4955 | 4942 |
| 4956 // Send the user agent override back. | 4943 // Send the user agent override back. |
| 4957 params.is_overriding_user_agent = internal_data->is_overriding_user_agent(); | 4944 params.is_overriding_user_agent = internal_data->is_overriding_user_agent(); |
| (...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6900 replaces_current_history_item(info.replaces_current_history_item), | 6887 replaces_current_history_item(info.replaces_current_history_item), |
| 6901 history_navigation_in_new_child_frame( | 6888 history_navigation_in_new_child_frame( |
| 6902 info.is_history_navigation_in_new_child_frame), | 6889 info.is_history_navigation_in_new_child_frame), |
| 6903 client_redirect(info.is_client_redirect), | 6890 client_redirect(info.is_client_redirect), |
| 6904 triggering_event_info(info.triggering_event_info), | 6891 triggering_event_info(info.triggering_event_info), |
| 6905 cache_disabled(info.is_cache_disabled), | 6892 cache_disabled(info.is_cache_disabled), |
| 6906 form(info.form), | 6893 form(info.form), |
| 6907 source_location(info.source_location) {} | 6894 source_location(info.source_location) {} |
| 6908 | 6895 |
| 6909 } // namespace content | 6896 } // namespace content |
| OLD | NEW |