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

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

Issue 1018383002: Make NavigationParams clearer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Charlie's comments Created 5 years, 9 months 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
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 "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/common/dom_storage/dom_storage_types.h" 8 #include "content/common/dom_storage/dom_storage_types.h"
9 #include "content/common/frame_messages.h" 9 #include "content/common/frame_messages.h"
10 #include "content/common/input_messages.h" 10 #include "content/common/input_messages.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 impl->focusedNodeChanged(blink::WebNode(), node); 361 impl->focusedNodeChanged(blink::WebNode(), node);
362 } 362 }
363 363
364 void RenderViewTest::Reload(const GURL& url) { 364 void RenderViewTest::Reload(const GURL& url) {
365 CommonNavigationParams common_params( 365 CommonNavigationParams common_params(
366 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, 366 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD,
367 true, base::TimeTicks(), FrameMsg_UILoadMetricsReportType::NO_REPORT, 367 true, base::TimeTicks(), FrameMsg_UILoadMetricsReportType::NO_REPORT,
368 GURL(), GURL()); 368 GURL(), GURL());
369 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 369 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
370 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), 370 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(),
371 CommitNavigationParams(), 371 RequestNavigationParams());
372 HistoryNavigationParams());
373 FrameLoadWaiter(impl->GetMainRenderFrame()).Wait(); 372 FrameLoadWaiter(impl->GetMainRenderFrame()).Wait();
374 } 373 }
375 374
376 uint32 RenderViewTest::GetNavigationIPCType() { 375 uint32 RenderViewTest::GetNavigationIPCType() {
377 return FrameHostMsg_DidCommitProvisionalLoad::ID; 376 return FrameHostMsg_DidCommitProvisionalLoad::ID;
378 } 377 }
379 378
380 void RenderViewTest::Resize(gfx::Size new_size, 379 void RenderViewTest::Resize(gfx::Size new_size,
381 gfx::Rect resizer_rect, 380 gfx::Rect resizer_rect,
382 bool is_fullscreen) { 381 bool is_fullscreen) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 439 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
441 440
442 int history_list_length = impl->historyBackListCount() + 441 int history_list_length = impl->historyBackListCount() +
443 impl->historyForwardListCount() + 1; 442 impl->historyForwardListCount() + 1;
444 int pending_offset = offset + impl->history_list_offset_; 443 int pending_offset = offset + impl->history_list_offset_;
445 444
446 CommonNavigationParams common_params( 445 CommonNavigationParams common_params(
447 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, 446 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK,
448 FrameMsg_Navigate_Type::NORMAL, true, base::TimeTicks(), 447 FrameMsg_Navigate_Type::NORMAL, true, base::TimeTicks(),
449 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); 448 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL());
450 HistoryNavigationParams history_params( 449 RequestNavigationParams request_params;
451 state, impl->page_id_ + offset, pending_offset, 450 request_params.page_state = state;
452 impl->history_list_offset_, history_list_length, false); 451 request_params.page_id = impl->page_id_ + offset;
452 request_params.pending_history_list_offset = pending_offset;
453 request_params.current_history_list_offset = impl->history_list_offset_;
454 request_params.current_history_list_length = history_list_length;
453 455
454 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), 456 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(),
455 CommitNavigationParams(), 457 request_params);
456 history_params);
457 458
458 // The load actually happens asynchronously, so we pump messages to process 459 // The load actually happens asynchronously, so we pump messages to process
459 // the pending continuation. 460 // the pending continuation.
460 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); 461 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait();
461 } 462 }
462 463
463 } // namespace content 464 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698