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

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

Issue 2698773002: [iOS] Refactoring web CRWSessionController user agent code. (Closed)
Patch Set: Fix unit tests and rebase 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 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 } 1526 }
1527 1527
1528 - (BOOL)useDesktopUserAgent { 1528 - (BOOL)useDesktopUserAgent {
1529 web::NavigationItem* currentItem = self.currentNavigationItem; 1529 web::NavigationItem* currentItem = self.currentNavigationItem;
1530 return currentItem && currentItem->IsOverridingUserAgent(); 1530 return currentItem && currentItem->IsOverridingUserAgent();
1531 } 1531 }
1532 1532
1533 - (void)enableDesktopUserAgent { 1533 - (void)enableDesktopUserAgent {
1534 DCHECK_EQ(self.useDesktopUserAgent, NO); 1534 DCHECK_EQ(self.useDesktopUserAgent, NO);
1535 DCHECK([self navigationManager]); 1535 DCHECK([self navigationManager]);
1536 [[self navigationManager]->GetSessionController() 1536 [self navigationManager]->OverrideDesktopUserAgentForNextPendingItem();
1537 useDesktopUserAgentForNextPendingItem];
1538 } 1537 }
1539 1538
1540 - (void)reloadForDesktopUserAgent { 1539 - (void)reloadForDesktopUserAgent {
1541 // |loadWithParams| will recreate the removed UIWebView. 1540 // |loadWithParams| will recreate the removed UIWebView.
1542 [self.webController requirePageReconstruction]; 1541 [self.webController requirePageReconstruction];
1543 1542
1544 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem 1543 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem
1545 // discusses making tab responsible for distinguishing history stack 1544 // discusses making tab responsible for distinguishing history stack
1546 // navigation from new navigations. Because we want a new navigation here, we 1545 // navigation from new navigations. Because we want a new navigation here, we
1547 // use |PAGE_TRANSITION_FORM_SUBMIT|. When session_controller changes, so 1546 // use |PAGE_TRANSITION_FORM_SUBMIT|. When session_controller changes, so
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 2210
2212 - (TabModel*)parentTabModel { 2211 - (TabModel*)parentTabModel {
2213 return parentTabModel_; 2212 return parentTabModel_;
2214 } 2213 }
2215 2214
2216 - (FormInputAccessoryViewController*)inputAccessoryViewController { 2215 - (FormInputAccessoryViewController*)inputAccessoryViewController {
2217 return inputAccessoryViewController_.get(); 2216 return inputAccessoryViewController_.get();
2218 } 2217 }
2219 2218
2220 @end 2219 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/native_app_launcher/native_app_navigation_util_unittest.mm ('k') | ios/chrome/browser/tabs/tab_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698