OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "ios/chrome/browser/tabs/tab.h" | 5 #import "ios/chrome/browser/tabs/tab.h" |
6 | 6 |
7 #import <CoreLocation/CoreLocation.h> | 7 #import <CoreLocation/CoreLocation.h> |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 - (BOOL)usesDesktopUserAgent { | 1361 - (BOOL)usesDesktopUserAgent { |
1362 if (!self.navigationManager) | 1362 if (!self.navigationManager) |
1363 return NO; | 1363 return NO; |
1364 | 1364 |
1365 web::NavigationItem* visibleItem = self.navigationManager->GetVisibleItem(); | 1365 web::NavigationItem* visibleItem = self.navigationManager->GetVisibleItem(); |
1366 return visibleItem && | 1366 return visibleItem && |
1367 visibleItem->GetUserAgentType() == web::UserAgentType::DESKTOP; | 1367 visibleItem->GetUserAgentType() == web::UserAgentType::DESKTOP; |
1368 } | 1368 } |
1369 | 1369 |
1370 - (void)reloadWithUserAgentType:(web::UserAgentType)userAgentType { | 1370 - (void)reloadWithUserAgentType:(web::UserAgentType)userAgentType { |
| 1371 // This removes the web view, which will be recreated at the end of this. |
| 1372 [self.webController requirePageReconstruction]; |
| 1373 |
1371 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem | 1374 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem |
1372 // discusses making tab responsible for distinguishing history stack | 1375 // discusses making tab responsible for distinguishing history stack |
1373 // navigation from new navigations. | 1376 // navigation from new navigations. |
1374 web::NavigationManager* navigationManager = [self navigationManager]; | 1377 web::NavigationManager* navigationManager = [self navigationManager]; |
1375 DCHECK(navigationManager); | 1378 DCHECK(navigationManager); |
1376 | 1379 |
1377 web::NavigationItem* lastNonRedirectItem = | 1380 web::NavigationItem* lastNonRedirectItem = |
1378 navigationManager->GetTransientItem(); | 1381 navigationManager->GetTransientItem(); |
1379 if (!lastNonRedirectItem || IsItemRedirectItem(lastNonRedirectItem)) | 1382 if (!lastNonRedirectItem || IsItemRedirectItem(lastNonRedirectItem)) |
1380 lastNonRedirectItem = navigationManager->GetVisibleItem(); | 1383 lastNonRedirectItem = navigationManager->GetVisibleItem(); |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1982 | 1985 |
1983 - (TabModel*)parentTabModel { | 1986 - (TabModel*)parentTabModel { |
1984 return parentTabModel_; | 1987 return parentTabModel_; |
1985 } | 1988 } |
1986 | 1989 |
1987 - (FormInputAccessoryViewController*)inputAccessoryViewController { | 1990 - (FormInputAccessoryViewController*)inputAccessoryViewController { |
1988 return inputAccessoryViewController_.get(); | 1991 return inputAccessoryViewController_.get(); |
1989 } | 1992 } |
1990 | 1993 |
1991 @end | 1994 @end |
OLD | NEW |