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

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

Issue 2711683002: (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)
Patch Set: Remove IsUsingDesktopUserAgent in NavigationManagerImpl 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 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 1560
1561 [self.readerModeController exitReaderMode]; 1561 [self.readerModeController exitReaderMode];
1562 } 1562 }
1563 1563
1564 #pragma mark - 1564 #pragma mark -
1565 1565
1566 - (void)openAppStore:(NSString*)appId { 1566 - (void)openAppStore:(NSString*)appId {
1567 [storeKitLauncher_ openAppStore:appId]; 1567 [storeKitLauncher_ openAppStore:appId];
1568 } 1568 }
1569 1569
1570 - (BOOL)useDesktopUserAgent { 1570 - (BOOL)isUsingDesktopUserAgent {
1571 web::NavigationItem* currentItem = self.currentNavigationItem; 1571 web::NavigationItem* visibleItem = [self navigationManager]->GetVisibleItem();
1572 return currentItem && currentItem->IsOverridingUserAgent(); 1572 return visibleItem && visibleItem->IsOverridingUserAgent();
1573 } 1573 }
1574 1574
1575 - (void)enableDesktopUserAgent { 1575 - (void)enableDesktopUserAgent {
1576 DCHECK_EQ(self.useDesktopUserAgent, NO); 1576 DCHECK_EQ(self.usesDesktopUserAgent, NO);
1577 DCHECK([self navigationManager]); 1577 DCHECK([self navigationManager]);
1578 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem(); 1578 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem();
1579 } 1579 }
1580 1580
1581 - (void)reloadForDesktopUserAgent { 1581 - (void)reloadForDesktopUserAgent {
1582 // |loadWithParams| will recreate the removed UIWebView. 1582 // |loadWithParams| will recreate the removed UIWebView.
1583 [self.webController requirePageReconstruction]; 1583 [self.webController requirePageReconstruction];
1584 1584
1585 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem 1585 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem
1586 // discusses making tab responsible for distinguishing history stack 1586 // discusses making tab responsible for distinguishing history stack
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 2223
2224 - (TabModel*)parentTabModel { 2224 - (TabModel*)parentTabModel {
2225 return parentTabModel_; 2225 return parentTabModel_;
2226 } 2226 }
2227 2227
2228 - (FormInputAccessoryViewController*)inputAccessoryViewController { 2228 - (FormInputAccessoryViewController*)inputAccessoryViewController {
2229 return inputAccessoryViewController_.get(); 2229 return inputAccessoryViewController_.get();
2230 } 2230 }
2231 2231
2232 @end 2232 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698