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 3563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3574 "SessionRestore.SubFrameUniqueNameChangedBeforeFirstCommit", | 3574 "SessionRestore.SubFrameUniqueNameChangedBeforeFirstCommit", |
3575 name_changed_before_first_commit_); | 3575 name_changed_before_first_commit_); |
3576 } | 3576 } |
3577 committed_first_load_ = true; | 3577 committed_first_load_ = true; |
3578 } | 3578 } |
3579 | 3579 |
3580 DocumentState* document_state = | 3580 DocumentState* document_state = |
3581 DocumentState::FromDataSource(frame->dataSource()); | 3581 DocumentState::FromDataSource(frame->dataSource()); |
3582 NavigationStateImpl* navigation_state = | 3582 NavigationStateImpl* navigation_state = |
3583 static_cast<NavigationStateImpl*>(document_state->navigation_state()); | 3583 static_cast<NavigationStateImpl*>(document_state->navigation_state()); |
| 3584 const WebURLResponse& web_url_response = frame->dataSource()->response(); |
3584 WebURLResponseExtraDataImpl* extra_data = | 3585 WebURLResponseExtraDataImpl* extra_data = |
3585 GetExtraDataFromResponse(frame->dataSource()->response()); | 3586 GetExtraDataFromResponse(web_url_response); |
3586 // Only update the PreviewsState and effective connection type states for new | 3587 // Only update the PreviewsState and effective connection type states for new |
3587 // main frame documents. Subframes inherit from the main frame and should not | 3588 // main frame documents. Subframes inherit from the main frame and should not |
3588 // change at commit time. | 3589 // change at commit time. |
3589 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { | 3590 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { |
3590 previews_state_ = | 3591 previews_state_ = |
3591 extra_data ? extra_data->previews_state() : PREVIEWS_OFF; | 3592 extra_data ? extra_data->previews_state() : PREVIEWS_OFF; |
| 3593 |
| 3594 // Set lite pages off if a lite page was not loaded for the main frame. |
| 3595 if (web_url_response |
| 3596 .httpHeaderField( |
| 3597 WebString::fromUTF8(kChromeProxyContentTransformHeader)) |
| 3598 .utf8() != kChromeProxyLitePageDirective) { |
| 3599 previews_state_ &= ~(SERVER_LITE_PAGE_ON); |
| 3600 } |
| 3601 |
3592 if (extra_data) { | 3602 if (extra_data) { |
3593 effective_connection_type_ = | 3603 effective_connection_type_ = |
3594 EffectiveConnectionTypeToWebEffectiveConnectionType( | 3604 EffectiveConnectionTypeToWebEffectiveConnectionType( |
3595 extra_data->effective_connection_type()); | 3605 extra_data->effective_connection_type()); |
3596 } | 3606 } |
3597 } | 3607 } |
3598 | 3608 |
3599 if (proxy_routing_id_ != MSG_ROUTING_NONE) { | 3609 if (proxy_routing_id_ != MSG_ROUTING_NONE) { |
3600 // If this is a provisional frame associated with a proxy (i.e., a frame | 3610 // If this is a provisional frame associated with a proxy (i.e., a frame |
3601 // created for a remote-to-local navigation), swap it into the frame tree | 3611 // created for a remote-to-local navigation), swap it into the frame tree |
(...skipping 3247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6849 // event target. Potentially a Pepper plugin will receive the event. | 6859 // event target. Potentially a Pepper plugin will receive the event. |
6850 // In order to tell whether a plugin gets the last mouse event and which it | 6860 // In order to tell whether a plugin gets the last mouse event and which it |
6851 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6861 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6852 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6862 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6853 // |pepper_last_mouse_event_target_|. | 6863 // |pepper_last_mouse_event_target_|. |
6854 pepper_last_mouse_event_target_ = nullptr; | 6864 pepper_last_mouse_event_target_ = nullptr; |
6855 #endif | 6865 #endif |
6856 } | 6866 } |
6857 | 6867 |
6858 } // namespace content | 6868 } // namespace content |
OLD | NEW |