OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 3037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3048 if (event_time != 0.0) | 3048 if (event_time != 0.0) |
3049 navigation_state->set_request_time(Time::FromDoubleT(event_time)); | 3049 navigation_state->set_request_time(Time::FromDoubleT(event_time)); |
3050 } | 3050 } |
3051 | 3051 |
3052 // Start time is only set after request time. | 3052 // Start time is only set after request time. |
3053 navigation_state->set_start_load_time(Time::Now()); | 3053 navigation_state->set_start_load_time(Time::Now()); |
3054 | 3054 |
3055 bool is_top_most = !frame->parent(); | 3055 bool is_top_most = !frame->parent(); |
3056 if (is_top_most) { | 3056 if (is_top_most) { |
3057 navigation_gesture_ = frame->isProcessingUserGesture() ? | 3057 navigation_gesture_ = frame->isProcessingUserGesture() ? |
3058 NavigationGestureUnknown : NavigationGestureAuto; | 3058 NavigationGestureUser : NavigationGestureAuto; |
3059 | 3059 |
3060 // Make sure redirect tracking state is clear for the new load. | 3060 // Make sure redirect tracking state is clear for the new load. |
3061 completed_client_redirect_src_ = GURL(); | 3061 completed_client_redirect_src_ = GURL(); |
3062 } else if (frame->parent()->isLoading()) { | 3062 } else if (frame->parent()->isLoading()) { |
3063 // Take note of AUTO_SUBFRAME loads here, so that we can know how to | 3063 // Take note of AUTO_SUBFRAME loads here, so that we can know how to |
3064 // load an error page. See didFailProvisionalLoad. | 3064 // load an error page. See didFailProvisionalLoad. |
3065 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME); | 3065 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME); |
3066 } | 3066 } |
3067 | 3067 |
3068 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( | 3068 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3412 request.setCachePolicy(state->cache_policy_override()); | 3412 request.setCachePolicy(state->cache_policy_override()); |
3413 } | 3413 } |
3414 | 3414 |
3415 if (top_data_source) { | 3415 if (top_data_source) { |
3416 NavigationState* state = NavigationState::FromDataSource(top_data_source); | 3416 NavigationState* state = NavigationState::FromDataSource(top_data_source); |
3417 if (state && request.targetType() == WebURLRequest::TargetIsPrefetch) | 3417 if (state && request.targetType() == WebURLRequest::TargetIsPrefetch) |
3418 state->set_was_prefetcher(true); | 3418 state->set_was_prefetcher(true); |
3419 } | 3419 } |
3420 | 3420 |
3421 request.setRequestorID(routing_id_); | 3421 request.setRequestorID(routing_id_); |
| 3422 request.setHasUserGesture(frame->isProcessingUserGesture()); |
| 3423 |
3422 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoReferrers)) | 3424 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoReferrers)) |
3423 request.clearHTTPHeaderField("Referer"); | 3425 request.clearHTTPHeaderField("Referer"); |
3424 | 3426 |
3425 // Temporary metrics, see site_isolation_metrics.h | 3427 // Temporary metrics, see site_isolation_metrics.h |
3426 SiteIsolationMetrics::AddRequest(identifier, request.targetType()); | 3428 SiteIsolationMetrics::AddRequest(identifier, request.targetType()); |
3427 } | 3429 } |
3428 | 3430 |
3429 void RenderView::didReceiveResponse( | 3431 void RenderView::didReceiveResponse( |
3430 WebFrame* frame, unsigned identifier, const WebURLResponse& response) { | 3432 WebFrame* frame, unsigned identifier, const WebURLResponse& response) { |
3431 | 3433 |
(...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5487 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), | 5489 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), |
5488 message_id); | 5490 message_id); |
5489 } | 5491 } |
5490 | 5492 |
5491 #if defined(OS_MACOSX) | 5493 #if defined(OS_MACOSX) |
5492 void RenderView::OnSelectPopupMenuItem(int selected_index) { | 5494 void RenderView::OnSelectPopupMenuItem(int selected_index) { |
5493 external_popup_menu_->DidSelectItem(selected_index); | 5495 external_popup_menu_->DidSelectItem(selected_index); |
5494 external_popup_menu_.reset(); | 5496 external_popup_menu_.reset(); |
5495 } | 5497 } |
5496 #endif | 5498 #endif |
OLD | NEW |