Chromium Code Reviews| 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 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3250 InternalDocumentStateData::FromDocumentState(document_state); | 3250 InternalDocumentStateData::FromDocumentState(document_state); |
| 3251 | 3251 |
| 3252 if (document_state->commit_load_time().is_null()) | 3252 if (document_state->commit_load_time().is_null()) |
| 3253 document_state->set_commit_load_time(Time::Now()); | 3253 document_state->set_commit_load_time(Time::Now()); |
| 3254 | 3254 |
| 3255 if (internal_data->must_reset_scroll_and_scale_state()) { | 3255 if (internal_data->must_reset_scroll_and_scale_state()) { |
| 3256 render_view_->webview()->resetScrollAndScaleState(); | 3256 render_view_->webview()->resetScrollAndScaleState(); |
| 3257 internal_data->set_must_reset_scroll_and_scale_state(false); | 3257 internal_data->set_must_reset_scroll_and_scale_state(false); |
| 3258 } | 3258 } |
| 3259 | 3259 |
| 3260 const auto& request_params = navigation_state->request_params(); | |
|
Charlie Reis
2016/05/13 19:14:32
nit: I think it's useful documentation to leave th
Andrey Kraynov
2016/05/16 08:03:11
Done.
| |
| 3260 bool is_new_navigation = commit_type == blink::WebStandardCommit; | 3261 bool is_new_navigation = commit_type == blink::WebStandardCommit; |
| 3261 if (is_new_navigation) { | 3262 bool should_init_page_id = render_view_->page_id_ == -1 && |
|
Charlie Reis
2016/05/13 19:14:32
Let's add a comment above this:
Ensure that we al
Andrey Kraynov
2016/05/16 08:03:11
Done.
| |
| 3263 request_params.page_id == -1 && | |
| 3264 request_params.nav_entry_id != 0 && | |
| 3265 !navigation_state->IsContentInitiated(); | |
| 3266 if (is_new_navigation || should_init_page_id) { | |
| 3262 // We bump our Page ID to correspond with the new session history entry. | 3267 // We bump our Page ID to correspond with the new session history entry. |
| 3263 render_view_->page_id_ = render_view_->next_page_id_++; | 3268 render_view_->page_id_ = render_view_->next_page_id_++; |
| 3264 | 3269 |
| 3265 DCHECK(!navigation_state->common_params().should_replace_current_entry || | 3270 DCHECK(!navigation_state->common_params().should_replace_current_entry || |
| 3266 render_view_->history_list_length_ > 0); | 3271 render_view_->history_list_length_ > 0); |
| 3267 if (!navigation_state->common_params().should_replace_current_entry) { | 3272 if (!navigation_state->common_params().should_replace_current_entry) { |
| 3268 // Advance our offset in session history, applying the length limit. | 3273 // Advance our offset in session history, applying the length limit. |
| 3269 // There is now no forward history. | 3274 // There is now no forward history. |
| 3270 render_view_->history_list_offset_++; | 3275 render_view_->history_list_offset_++; |
| 3271 if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) | 3276 if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) |
| 3272 render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; | 3277 render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; |
| 3273 render_view_->history_list_length_ = | 3278 render_view_->history_list_length_ = |
| 3274 render_view_->history_list_offset_ + 1; | 3279 render_view_->history_list_offset_ + 1; |
| 3275 } | 3280 } |
| 3276 } else { | 3281 } else { |
| 3277 const RequestNavigationParams& request_params = | |
| 3278 navigation_state->request_params(); | |
| 3279 if (request_params.nav_entry_id != 0 && | 3282 if (request_params.nav_entry_id != 0 && |
| 3280 !request_params.intended_as_new_entry) { | 3283 !request_params.intended_as_new_entry) { |
| 3281 // This is a successful session history navigation! | 3284 // This is a successful session history navigation! |
| 3282 render_view_->page_id_ = request_params.page_id; | 3285 render_view_->page_id_ = request_params.page_id; |
| 3283 | 3286 |
| 3284 render_view_->history_list_offset_ = | 3287 render_view_->history_list_offset_ = |
| 3285 request_params.pending_history_list_offset; | 3288 request_params.pending_history_list_offset; |
| 3286 } | 3289 } |
| 3287 } | 3290 } |
| 3288 | 3291 |
| (...skipping 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6144 // event target. Potentially a Pepper plugin will receive the event. | 6147 // event target. Potentially a Pepper plugin will receive the event. |
| 6145 // In order to tell whether a plugin gets the last mouse event and which it | 6148 // In order to tell whether a plugin gets the last mouse event and which it |
| 6146 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6149 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6147 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6150 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6148 // |pepper_last_mouse_event_target_|. | 6151 // |pepper_last_mouse_event_target_|. |
| 6149 pepper_last_mouse_event_target_ = nullptr; | 6152 pepper_last_mouse_event_target_ = nullptr; |
| 6150 #endif | 6153 #endif |
| 6151 } | 6154 } |
| 6152 | 6155 |
| 6153 } // namespace content | 6156 } // namespace content |
| OLD | NEW |