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

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

Issue 2741413007: Refactoring Reload in NavigationManager and CRWWebController. (Closed)
Patch Set: tentative change 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 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> 354 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>>
364 NavigationManagerImpl::GetTransientURLRewriters() { 355 NavigationManagerImpl::GetTransientURLRewriters() {
365 return std::move(transient_url_rewriters_); 356 return std::move(transient_url_rewriters_);
366 } 357 }
367 358
368 void NavigationManagerImpl::RemoveTransientURLRewriters() { 359 void NavigationManagerImpl::RemoveTransientURLRewriters() {
369 transient_url_rewriters_.reset(); 360 transient_url_rewriters_.reset();
370 } 361 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 const ScopedNavigationItemImplList& items = [session_controller_ items]; 446 const ScopedNavigationItemImplList& items = [session_controller_ items];
456 while (index >= 0) { 447 while (index >= 0) {
457 NavigationItem* item = items[index--].get(); 448 NavigationItem* item = items[index--].get();
458 if (!client->IsAppSpecificURL(item->GetVirtualURL())) 449 if (!client->IsAppSpecificURL(item->GetVirtualURL()))
459 return item; 450 return item;
460 } 451 }
461 return nullptr; 452 return nullptr;
462 } 453 }
463 454
464 } // namespace web 455 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698