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

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

Issue 2698773002: [iOS] Refactoring web CRWSessionController user agent code. (Closed)
Patch Set: Addressed feedback 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 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 } 1514 }
1515 1515
1516 - (BOOL)useDesktopUserAgent { 1516 - (BOOL)useDesktopUserAgent {
1517 web::NavigationItem* currentItem = self.currentNavigationItem; 1517 web::NavigationItem* currentItem = self.currentNavigationItem;
1518 return currentItem && currentItem->IsOverridingUserAgent(); 1518 return currentItem && currentItem->IsOverridingUserAgent();
1519 } 1519 }
1520 1520
1521 - (void)enableDesktopUserAgent { 1521 - (void)enableDesktopUserAgent {
1522 DCHECK_EQ(self.useDesktopUserAgent, NO); 1522 DCHECK_EQ(self.useDesktopUserAgent, NO);
1523 DCHECK([self navigationManager]); 1523 DCHECK([self navigationManager]);
1524 [[self navigationManager]->GetSessionController() 1524 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem();
1525 useDesktopUserAgentForNextPendingItem];
1526 } 1525 }
1527 1526
1528 - (void)reloadForDesktopUserAgent { 1527 - (void)reloadForDesktopUserAgent {
1529 // |loadWithParams| will recreate the removed UIWebView. 1528 // |loadWithParams| will recreate the removed UIWebView.
1530 [self.webController requirePageReconstruction]; 1529 [self.webController requirePageReconstruction];
1531 1530
1532 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem 1531 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem
1533 // discusses making tab responsible for distinguishing history stack 1532 // discusses making tab responsible for distinguishing history stack
1534 // navigation from new navigations. Because we want a new navigation here, we 1533 // navigation from new navigations. Because we want a new navigation here, we
1535 // use |PAGE_TRANSITION_FORM_SUBMIT|. When session_controller changes, so 1534 // use |PAGE_TRANSITION_FORM_SUBMIT|. When session_controller changes, so
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
2199 2198
2200 - (TabModel*)parentTabModel { 2199 - (TabModel*)parentTabModel {
2201 return parentTabModel_; 2200 return parentTabModel_;
2202 } 2201 }
2203 2202
2204 - (FormInputAccessoryViewController*)inputAccessoryViewController { 2203 - (FormInputAccessoryViewController*)inputAccessoryViewController {
2205 return inputAccessoryViewController_.get(); 2204 return inputAccessoryViewController_.get();
2206 } 2205 }
2207 2206
2208 @end 2207 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698