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

Side by Side Diff: ios/web/navigation/navigation_manager_impl.mm

Issue 2741413007: Refactoring Reload in NavigationManager and CRWWebController. (Closed)
Patch Set: Addressed high level comments Created 3 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 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 #import "ios/web/navigation/navigation_manager_impl.h" 5 #import "ios/web/navigation/navigation_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 348
349 void NavigationManagerImpl::Reload(ReloadType reload_type, 349 void NavigationManagerImpl::Reload(ReloadType reload_type,
350 bool check_for_reposts) { 350 bool check_for_reposts) {
351 // Navigation manager may be empty if the only pending item failed to load 351 // Navigation manager may be empty if the only pending item failed to load
352 // with SSL error and the user has decided not to proceed. 352 // with SSL error and the user has decided not to proceed.
353 NavigationItem* item = GetVisibleItem(); 353 NavigationItem* item = GetVisibleItem();
354 GURL url = item ? item->GetURL() : GURL(url::kAboutBlankURL); 354 GURL url = item ? item->GetURL() : GURL(url::kAboutBlankURL);
355 web::Referrer referrer = item ? item->GetReferrer() : web::Referrer(); 355 web::Referrer referrer = item ? item->GetReferrer() : web::Referrer();
356 356
357 WebState::OpenURLParams params(url, referrer, 357 WebLoadParams params(url);
358 WindowOpenDisposition::CURRENT_TAB, 358 params.referrer = referrer;
359 ui::PAGE_TRANSITION_RELOAD, NO); 359 params.transition_type = ui::PAGE_TRANSITION_RELOAD;
360 delegate_->GetWebState()->OpenURL(params); 360
361 LoadURLWithParams(params);
361 } 362 }
362 363
363 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> 364 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>>
364 NavigationManagerImpl::GetTransientURLRewriters() { 365 NavigationManagerImpl::GetTransientURLRewriters() {
365 return std::move(transient_url_rewriters_); 366 return std::move(transient_url_rewriters_);
366 } 367 }
367 368
368 void NavigationManagerImpl::RemoveTransientURLRewriters() { 369 void NavigationManagerImpl::RemoveTransientURLRewriters() {
369 transient_url_rewriters_.reset(); 370 transient_url_rewriters_.reset();
370 } 371 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 const ScopedNavigationItemImplList& items = [session_controller_ items]; 456 const ScopedNavigationItemImplList& items = [session_controller_ items];
456 while (index >= 0) { 457 while (index >= 0) {
457 NavigationItem* item = items[index--].get(); 458 NavigationItem* item = items[index--].get();
458 if (!client->IsAppSpecificURL(item->GetVirtualURL())) 459 if (!client->IsAppSpecificURL(item->GetVirtualURL()))
459 return item; 460 return item;
460 } 461 }
461 return nullptr; 462 return nullptr;
462 } 463 }
463 464
464 } // namespace web 465 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698