Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: content/public/test/render_view_test.cc

Issue 2499313003: Set user_gesture bit at NavigationHandle creation time. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/browser/navigation_handle.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/public/test/render_view_test.h" 5 #include "content/public/test/render_view_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cctype> 9 #include <cctype>
10 10
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 507 }
508 508
509 void RenderViewTest::SetFocused(const blink::WebNode& node) { 509 void RenderViewTest::SetFocused(const blink::WebNode& node) {
510 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 510 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
511 impl->focusedNodeChanged(blink::WebNode(), node); 511 impl->focusedNodeChanged(blink::WebNode(), node);
512 } 512 }
513 513
514 void RenderViewTest::Reload(const GURL& url) { 514 void RenderViewTest::Reload(const GURL& url) {
515 CommonNavigationParams common_params( 515 CommonNavigationParams common_params(
516 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, 516 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD,
517 true, false, base::TimeTicks(), 517 NavigationGestureAuto, true, false, base::TimeTicks(),
518 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), 518 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
519 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr); 519 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr);
520 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 520 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
521 TestRenderFrame* frame = 521 TestRenderFrame* frame =
522 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 522 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
523 frame->Navigate(common_params, StartNavigationParams(), 523 frame->Navigate(common_params, StartNavigationParams(),
524 RequestNavigationParams()); 524 RequestNavigationParams());
525 FrameLoadWaiter(frame).Wait(); 525 FrameLoadWaiter(frame).Wait();
526 view_->GetWebView()->updateAllLifecyclePhases(); 526 view_->GetWebView()->updateAllLifecyclePhases();
527 } 527 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 const GURL& url, 642 const GURL& url,
643 const PageState& state) { 643 const PageState& state) {
644 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 644 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
645 645
646 int history_list_length = impl->historyBackListCount() + 646 int history_list_length = impl->historyBackListCount() +
647 impl->historyForwardListCount() + 1; 647 impl->historyForwardListCount() + 1;
648 int pending_offset = offset + impl->history_list_offset_; 648 int pending_offset = offset + impl->history_list_offset_;
649 649
650 CommonNavigationParams common_params( 650 CommonNavigationParams common_params(
651 url, Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, 651 url, Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK,
652 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), 652 FrameMsg_Navigate_Type::NORMAL, NavigationGestureAuto, true, false,
653 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), 653 base::TimeTicks(), FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(),
654 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr); 654 GURL(), LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr);
655 RequestNavigationParams request_params; 655 RequestNavigationParams request_params;
656 request_params.page_state = state; 656 request_params.page_state = state;
657 request_params.nav_entry_id = pending_offset + 1; 657 request_params.nav_entry_id = pending_offset + 1;
658 request_params.pending_history_list_offset = pending_offset; 658 request_params.pending_history_list_offset = pending_offset;
659 request_params.current_history_list_offset = impl->history_list_offset_; 659 request_params.current_history_list_offset = impl->history_list_offset_;
660 request_params.current_history_list_length = history_list_length; 660 request_params.current_history_list_length = history_list_length;
661 661
662 TestRenderFrame* frame = 662 TestRenderFrame* frame =
663 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 663 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
664 frame->Navigate(common_params, StartNavigationParams(), request_params); 664 frame->Navigate(common_params, StartNavigationParams(), request_params);
665 665
666 // The load actually happens asynchronously, so we pump messages to process 666 // The load actually happens asynchronously, so we pump messages to process
667 // the pending continuation. 667 // the pending continuation.
668 FrameLoadWaiter(frame).Wait(); 668 FrameLoadWaiter(frame).Wait();
669 view_->GetWebView()->updateAllLifecyclePhases(); 669 view_->GetWebView()->updateAllLifecyclePhases();
670 } 670 }
671 671
672 } // namespace content 672 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/navigation_handle.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698