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 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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)usesDesktopUserAgent { |
1571 web::NavigationItem* currentItem = self.currentNavigationItem; | 1571 if (![self navigationManager]) |
Eugene But (OOO till 7-30)
2017/02/23 18:00:11
nit: self.navigationManager because it's a propert
liaoyuke
2017/02/23 18:37:11
Done.
| |
1572 return currentItem && currentItem->IsOverridingUserAgent(); | 1572 return NO; |
1573 | |
1574 web::NavigationItem* visibleItem = [self navigationManager]->GetVisibleItem(); | |
Eugene But (OOO till 7-30)
2017/02/23 18:00:12
ditto
liaoyuke
2017/02/23 18:37:11
Done.
| |
1575 return visibleItem && visibleItem->IsOverridingUserAgent(); | |
1573 } | 1576 } |
1574 | 1577 |
1575 - (void)enableDesktopUserAgent { | 1578 - (void)enableDesktopUserAgent { |
1576 DCHECK_EQ(self.useDesktopUserAgent, NO); | 1579 DCHECK_EQ(self.usesDesktopUserAgent, NO); |
1577 DCHECK([self navigationManager]); | 1580 DCHECK([self navigationManager]); |
1578 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem(); | 1581 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem(); |
1579 } | 1582 } |
1580 | 1583 |
1581 - (void)reloadForDesktopUserAgent { | 1584 - (void)reloadForDesktopUserAgent { |
1582 // |loadWithParams| will recreate the removed UIWebView. | 1585 // |loadWithParams| will recreate the removed UIWebView. |
1583 [self.webController requirePageReconstruction]; | 1586 [self.webController requirePageReconstruction]; |
1584 | 1587 |
1585 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem | 1588 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem |
1586 // discusses making tab responsible for distinguishing history stack | 1589 // discusses making tab responsible for distinguishing history stack |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2223 | 2226 |
2224 - (TabModel*)parentTabModel { | 2227 - (TabModel*)parentTabModel { |
2225 return parentTabModel_; | 2228 return parentTabModel_; |
2226 } | 2229 } |
2227 | 2230 |
2228 - (FormInputAccessoryViewController*)inputAccessoryViewController { | 2231 - (FormInputAccessoryViewController*)inputAccessoryViewController { |
2229 return inputAccessoryViewController_.get(); | 2232 return inputAccessoryViewController_.get(); |
2230 } | 2233 } |
2231 | 2234 |
2232 @end | 2235 @end |
OLD | NEW |