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

Side by Side Diff: ios/chrome/browser/tabs/tab.mm

Issue 2710593010: Reland of (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)
Patch Set: Update comments Created 3 years, 10 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 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 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 1543
1544 [self.readerModeController exitReaderMode]; 1544 [self.readerModeController exitReaderMode];
1545 } 1545 }
1546 1546
1547 #pragma mark - 1547 #pragma mark -
1548 1548
1549 - (void)openAppStore:(NSString*)appId { 1549 - (void)openAppStore:(NSString*)appId {
1550 [storeKitLauncher_ openAppStore:appId]; 1550 [storeKitLauncher_ openAppStore:appId];
1551 } 1551 }
1552 1552
1553 - (BOOL)useDesktopUserAgent { 1553 - (BOOL)usesDesktopUserAgent {
1554 web::NavigationItem* currentItem = self.currentNavigationItem; 1554 if (!self.navigationManager)
1555 return currentItem && currentItem->IsOverridingUserAgent(); 1555 return NO;
1556
1557 web::NavigationItem* visibleItem = self.navigationManager->GetVisibleItem();
1558 return visibleItem && visibleItem->IsOverridingUserAgent();
1556 } 1559 }
1557 1560
1558 - (void)enableDesktopUserAgent { 1561 - (void)enableDesktopUserAgent {
1559 DCHECK_EQ(self.useDesktopUserAgent, NO); 1562 DCHECK_EQ(self.usesDesktopUserAgent, NO);
1560 DCHECK([self navigationManager]); 1563 DCHECK([self navigationManager]);
1561 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem(); 1564 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem();
1562 } 1565 }
1563 1566
1564 - (void)reloadForDesktopUserAgent { 1567 - (void)reloadForDesktopUserAgent {
1565 // |loadWithParams| will recreate the removed UIWebView. 1568 // |loadWithParams| will recreate the removed UIWebView.
1566 [self.webController requirePageReconstruction]; 1569 [self.webController requirePageReconstruction];
1567 1570
1568 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem 1571 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem
1569 // discusses making tab responsible for distinguishing history stack 1572 // discusses making tab responsible for distinguishing history stack
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
2206 2209
2207 - (TabModel*)parentTabModel { 2210 - (TabModel*)parentTabModel {
2208 return parentTabModel_; 2211 return parentTabModel_;
2209 } 2212 }
2210 2213
2211 - (FormInputAccessoryViewController*)inputAccessoryViewController { 2214 - (FormInputAccessoryViewController*)inputAccessoryViewController {
2212 return inputAccessoryViewController_.get(); 2215 return inputAccessoryViewController_.get();
2213 } 2216 }
2214 2217
2215 @end 2218 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698