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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 3309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3320 document_state->set_load_type(DocumentState::RELOAD); | 3320 document_state->set_load_type(DocumentState::RELOAD); |
3321 else if (!params.state.empty()) | 3321 else if (!params.state.empty()) |
3322 document_state->set_load_type(DocumentState::HISTORY_LOAD); | 3322 document_state->set_load_type(DocumentState::HISTORY_LOAD); |
3323 else | 3323 else |
3324 document_state->set_load_type(DocumentState::NORMAL_LOAD); | 3324 document_state->set_load_type(DocumentState::NORMAL_LOAD); |
3325 | 3325 |
3326 document_state->set_referrer_policy(params.referrer.policy); | 3326 document_state->set_referrer_policy(params.referrer.policy); |
3327 document_state->set_is_overriding_user_agent(params.is_overriding_user_agent); | 3327 document_state->set_is_overriding_user_agent(params.is_overriding_user_agent); |
3328 document_state->set_must_reset_scroll_and_scale_state( | 3328 document_state->set_must_reset_scroll_and_scale_state( |
3329 params.navigation_type == | 3329 params.navigation_type == |
3330 ViewMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL); | 3330 ViewMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL); |
jamesr
2013/02/21 22:38:32
if you just want to modify the behavior on page re
mnaganov (inactive)
2013/02/22 15:55:16
Thanks for pointing this out! But at this point I
| |
3331 document_state->set_can_load_local_resources(params.can_load_local_resources); | 3331 document_state->set_can_load_local_resources(params.can_load_local_resources); |
3332 } | 3332 } |
3333 | 3333 |
3334 NavigationState* RenderViewImpl::CreateNavigationStateFromPending() { | 3334 NavigationState* RenderViewImpl::CreateNavigationStateFromPending() { |
3335 const ViewMsg_Navigate_Params& params = *pending_navigation_params_.get(); | 3335 const ViewMsg_Navigate_Params& params = *pending_navigation_params_.get(); |
3336 NavigationState* navigation_state = NULL; | 3336 NavigationState* navigation_state = NULL; |
3337 | 3337 |
3338 // A navigation resulting from loading a javascript URL should not be treated | 3338 // A navigation resulting from loading a javascript URL should not be treated |
3339 // as a browser initiated event. Instead, we want it to look as if the page | 3339 // as a browser initiated event. Instead, we want it to look as if the page |
3340 // initiated any load resulting from JS execution. | 3340 // initiated any load resulting from JS execution. |
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5325 webview()->dragSourceEndedAt(client_point, screen_point, op); | 5325 webview()->dragSourceEndedAt(client_point, screen_point, op); |
5326 } else { | 5326 } else { |
5327 webview()->dragSourceMovedTo(client_point, screen_point, op); | 5327 webview()->dragSourceMovedTo(client_point, screen_point, op); |
5328 } | 5328 } |
5329 } | 5329 } |
5330 | 5330 |
5331 void RenderViewImpl::OnDragSourceSystemDragEnded() { | 5331 void RenderViewImpl::OnDragSourceSystemDragEnded() { |
5332 webview()->dragSourceSystemDragEnded(); | 5332 webview()->dragSourceSystemDragEnded(); |
5333 } | 5333 } |
5334 | 5334 |
5335 | |
5335 void RenderViewImpl::OnUpdateWebPreferences(const WebPreferences& prefs) { | 5336 void RenderViewImpl::OnUpdateWebPreferences(const WebPreferences& prefs) { |
5337 const bool old_initialize_at_minimum_page_scale = | |
5338 webkit_preferences_.initialize_at_minimum_page_scale; | |
5336 webkit_preferences_ = prefs; | 5339 webkit_preferences_ = prefs; |
5337 webkit_preferences_.Apply(webview()); | 5340 webkit_preferences_.Apply(webview()); |
5341 if (old_initialize_at_minimum_page_scale != | |
5342 webkit_preferences_.initialize_at_minimum_page_scale) { | |
5343 webview()->resetScrollAndScaleState(); | |
5344 } | |
5338 } | 5345 } |
5339 | 5346 |
5340 void RenderViewImpl::OnUpdateTimezone() { | 5347 void RenderViewImpl::OnUpdateTimezone() { |
5341 if (webview()) | 5348 if (webview()) |
5342 NotifyTimezoneChange(webview()->mainFrame()); | 5349 NotifyTimezoneChange(webview()->mainFrame()); |
5343 } | 5350 } |
5344 | 5351 |
5345 void RenderViewImpl::OnSetAltErrorPageURL(const GURL& url) { | 5352 void RenderViewImpl::OnSetAltErrorPageURL(const GURL& url) { |
5346 alternate_error_page_url_ = url; | 5353 alternate_error_page_url_ = url; |
5347 } | 5354 } |
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6671 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6678 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6672 RenderProcess::current()->ReleaseTransportDIB(dib); | 6679 RenderProcess::current()->ReleaseTransportDIB(dib); |
6673 } | 6680 } |
6674 | 6681 |
6675 void RenderViewImpl::DidCommitCompositorFrame() { | 6682 void RenderViewImpl::DidCommitCompositorFrame() { |
6676 RenderWidget::DidCommitCompositorFrame(); | 6683 RenderWidget::DidCommitCompositorFrame(); |
6677 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6684 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
6678 } | 6685 } |
6679 | 6686 |
6680 } // namespace content | 6687 } // namespace content |
OLD | NEW |