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

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

Issue 2741413007: Refactoring Reload in NavigationManager and CRWWebController. (Closed)
Patch Set: Rebase and Remove DCHECK in |loadWithParams| as it has already been taken care of 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 NavigationItemList NavigationManagerImpl::GetBackwardItems() const { 341 NavigationItemList NavigationManagerImpl::GetBackwardItems() const {
342 return [session_controller_ backwardItems]; 342 return [session_controller_ backwardItems];
343 } 343 }
344 344
345 NavigationItemList NavigationManagerImpl::GetForwardItems() const { 345 NavigationItemList NavigationManagerImpl::GetForwardItems() const {
346 return [session_controller_ forwardItems]; 346 return [session_controller_ forwardItems];
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 delegate_->Reload();
352 // with SSL error and the user has decided not to proceed.
353 NavigationItem* item = GetVisibleItem();
354 GURL url = item ? item->GetURL() : GURL(url::kAboutBlankURL);
355 web::Referrer referrer = item ? item->GetReferrer() : web::Referrer();
356
357 WebState::OpenURLParams params(url, referrer,
358 WindowOpenDisposition::CURRENT_TAB,
359 ui::PAGE_TRANSITION_RELOAD, NO);
360 delegate_->GetWebState()->OpenURL(params);
361 } 352 }
362 353
363 void NavigationManagerImpl::CopyStateFromAndPrune( 354 void NavigationManagerImpl::CopyStateFromAndPrune(
364 const NavigationManager* manager) { 355 const NavigationManager* manager) {
365 DCHECK(manager); 356 DCHECK(manager);
366 CRWSessionController* other_session = 357 CRWSessionController* other_session =
367 static_cast<const NavigationManagerImpl*>(manager)->session_controller_; 358 static_cast<const NavigationManagerImpl*>(manager)->session_controller_;
368 [session_controller_ copyStateFromSessionControllerAndPrune:other_session]; 359 [session_controller_ copyStateFromSessionControllerAndPrune:other_session];
369 } 360 }
370 361
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 const ScopedNavigationItemImplList& items = [session_controller_ items]; 458 const ScopedNavigationItemImplList& items = [session_controller_ items];
468 while (index >= 0) { 459 while (index >= 0) {
469 NavigationItem* item = items[index--].get(); 460 NavigationItem* item = items[index--].get();
470 if (!client->IsAppSpecificURL(item->GetVirtualURL())) 461 if (!client->IsAppSpecificURL(item->GetVirtualURL()))
471 return item; 462 return item;
472 } 463 }
473 return nullptr; 464 return nullptr;
474 } 465 }
475 466
476 } // namespace web 467 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/navigation/navigation_manager_delegate.h ('k') | ios/web/navigation/navigation_manager_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698