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 | |
1374 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem | 1371 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem |
1375 // discusses making tab responsible for distinguishing history stack | 1372 // discusses making tab responsible for distinguishing history stack |
1376 // navigation from new navigations. | 1373 // navigation from new navigations. |
1377 web::NavigationManager* navigationManager = [self navigationManager]; | 1374 web::NavigationManager* navigationManager = [self navigationManager]; |
1378 DCHECK(navigationManager); | 1375 DCHECK(navigationManager); |
1379 | 1376 |
1380 web::NavigationItem* lastNonRedirectItem = | 1377 web::NavigationItem* lastNonRedirectItem = |
1381 navigationManager->GetTransientItem(); | 1378 navigationManager->GetTransientItem(); |
1382 if (!lastNonRedirectItem || IsItemRedirectItem(lastNonRedirectItem)) | 1379 if (!lastNonRedirectItem || IsItemRedirectItem(lastNonRedirectItem)) |
1383 lastNonRedirectItem = navigationManager->GetVisibleItem(); | 1380 lastNonRedirectItem = navigationManager->GetVisibleItem(); |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1985 | 1982 |
1986 - (TabModel*)parentTabModel { | 1983 - (TabModel*)parentTabModel { |
1987 return parentTabModel_; | 1984 return parentTabModel_; |
1988 } | 1985 } |
1989 | 1986 |
1990 - (FormInputAccessoryViewController*)inputAccessoryViewController { | 1987 - (FormInputAccessoryViewController*)inputAccessoryViewController { |
1991 return inputAccessoryViewController_.get(); | 1988 return inputAccessoryViewController_.get(); |
1992 } | 1989 } |
1993 | 1990 |
1994 @end | 1991 @end |
OLD | NEW |