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

Side by Side Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2710593010: Reland of (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)
Patch Set: Update comments Created 3 years, 9 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/ui/browser_view_controller.h" 5 #import "ios/chrome/browser/ui/browser_view_controller.h"
6 6
7 #import <AssetsLibrary/AssetsLibrary.h> 7 #import <AssetsLibrary/AssetsLibrary.h>
8 #import <MobileCoreServices/MobileCoreServices.h> 8 #import <MobileCoreServices/MobileCoreServices.h>
9 #import <PassKit/PassKit.h> 9 #import <PassKit/PassKit.h>
10 #import <Photos/Photos.h> 10 #import <Photos/Photos.h>
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 1062
1063 return [tab canSwitchToReaderMode]; 1063 return [tab canSwitchToReaderMode];
1064 } 1064 }
1065 1065
1066 - (BOOL)canUseDesktopUserAgent { 1066 - (BOOL)canUseDesktopUserAgent {
1067 Tab* tab = [_model currentTab]; 1067 Tab* tab = [_model currentTab];
1068 if ([self isTabNativePage:tab]) 1068 if ([self isTabNativePage:tab])
1069 return NO; 1069 return NO;
1070 1070
1071 // If |useDesktopUserAgent| is |NO|, allow useDesktopUserAgent. 1071 // If |useDesktopUserAgent| is |NO|, allow useDesktopUserAgent.
1072 return !tab.useDesktopUserAgent; 1072 return !tab.usesDesktopUserAgent;
1073 } 1073 }
1074 1074
1075 // Whether the sharing menu should be shown. 1075 // Whether the sharing menu should be shown.
1076 - (BOOL)canShowShareMenu { 1076 - (BOOL)canShowShareMenu {
1077 Tab* tab = [_model currentTab]; 1077 Tab* tab = [_model currentTab];
1078 // TODO(shreyasv): Make it so the URL returned by the tab is always valid and 1078 // TODO(shreyasv): Make it so the URL returned by the tab is always valid and
1079 // remove check on net::NSURLWithGURL(tab.url) ( http://crbug.com/400999 ). 1079 // remove check on net::NSURLWithGURL(tab.url) ( http://crbug.com/400999 ).
1080 return tab && !tab.url.SchemeIs(kChromeUIScheme) && 1080 return tab && !tab.url.SchemeIs(kChromeUIScheme) &&
1081 net::NSURLWithGURL(tab.url); 1081 net::NSURLWithGURL(tab.url);
1082 } 1082 }
(...skipping 3724 matching lines...) Expand 10 before | Expand all | Expand 10 after
4807 if ((seenToolbar && !seenInfoBarContainer) || 4807 if ((seenToolbar && !seenInfoBarContainer) ||
4808 (seenInfoBarContainer && !seenContentArea)) 4808 (seenInfoBarContainer && !seenContentArea))
4809 return NO; 4809 return NO;
4810 } 4810 }
4811 return YES; 4811 return YES;
4812 } 4812 }
4813 4813
4814 #pragma mark - PreloadControllerDelegate methods 4814 #pragma mark - PreloadControllerDelegate methods
4815 4815
4816 - (BOOL)shouldUseDesktopUserAgent { 4816 - (BOOL)shouldUseDesktopUserAgent {
4817 return [_model currentTab].useDesktopUserAgent; 4817 return [_model currentTab].usesDesktopUserAgent;
4818 } 4818 }
4819 4819
4820 - (CRWSessionEntry*)currentSessionEntry { 4820 - (CRWSessionEntry*)currentSessionEntry {
4821 Tab* tab = [_model currentTab]; 4821 Tab* tab = [_model currentTab];
4822 if (![tab navigationManager]) 4822 if (![tab navigationManager])
4823 return nil; 4823 return nil;
4824 return [[tab navigationManager]->GetSessionController() currentEntry]; 4824 return [[tab navigationManager]->GetSessionController() currentEntry];
4825 } 4825 }
4826 4826
4827 #pragma mark - BookmarkBridgeMethods 4827 #pragma mark - BookmarkBridgeMethods
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
5025 5025
5026 - (UIView*)voiceSearchButton { 5026 - (UIView*)voiceSearchButton {
5027 return _voiceSearchButton; 5027 return _voiceSearchButton;
5028 } 5028 }
5029 5029
5030 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5030 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5031 return [self currentLogoAnimationControllerOwner]; 5031 return [self currentLogoAnimationControllerOwner];
5032 } 5032 }
5033 5033
5034 @end 5034 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698