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

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

Issue 2711733007: Revert of (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)
Patch Set: 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
« no previous file with comments | « ios/chrome/browser/tabs/tab.h ('k') | ios/chrome/browser/ui/browser_view_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)usesDesktopUserAgent { 1570 - (BOOL)useDesktopUserAgent {
1571 if (!self.navigationManager) 1571 web::NavigationItem* currentItem = self.currentNavigationItem;
1572 return NO; 1572 return currentItem && currentItem->IsOverridingUserAgent();
1573
1574 web::NavigationItem* visibleItem = self.navigationManager->GetVisibleItem();
1575 return visibleItem && visibleItem->IsOverridingUserAgent();
1576 } 1573 }
1577 1574
1578 - (void)enableDesktopUserAgent { 1575 - (void)enableDesktopUserAgent {
1579 DCHECK_EQ(self.usesDesktopUserAgent, NO); 1576 DCHECK_EQ(self.useDesktopUserAgent, NO);
1580 DCHECK([self navigationManager]); 1577 DCHECK([self navigationManager]);
1581 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem(); 1578 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem();
1582 } 1579 }
1583 1580
1584 - (void)reloadForDesktopUserAgent { 1581 - (void)reloadForDesktopUserAgent {
1585 // |loadWithParams| will recreate the removed UIWebView. 1582 // |loadWithParams| will recreate the removed UIWebView.
1586 [self.webController requirePageReconstruction]; 1583 [self.webController requirePageReconstruction];
1587 1584
1588 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem 1585 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem
1589 // 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
2226 2223
2227 - (TabModel*)parentTabModel { 2224 - (TabModel*)parentTabModel {
2228 return parentTabModel_; 2225 return parentTabModel_;
2229 } 2226 }
2230 2227
2231 - (FormInputAccessoryViewController*)inputAccessoryViewController { 2228 - (FormInputAccessoryViewController*)inputAccessoryViewController {
2232 return inputAccessoryViewController_.get(); 2229 return inputAccessoryViewController_.get();
2233 } 2230 }
2234 2231
2235 @end 2232 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab.h ('k') | ios/chrome/browser/ui/browser_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698