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

Unified Diff: ios/chrome/browser/tabs/tab.mm

Issue 2599313002: Create headerHeightForTab in TabHeadersDelegate. (Closed)
Patch Set: cleanup Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index dac801e1c4f1db0c0e1a3326758002f4ff205054..24b3884c99aa2c9fafbc22352f676b383d0a30c8 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -93,6 +93,7 @@
#include "ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.h"
#import "ios/chrome/browser/tabs/tab_delegate.h"
#import "ios/chrome/browser/tabs/tab_dialog_delegate.h"
+#import "ios/chrome/browser/tabs/tab_headers_delegate.h"
#import "ios/chrome/browser/tabs/tab_model.h"
#import "ios/chrome/browser/tabs/tab_private.h"
#import "ios/chrome/browser/tabs/tab_snapshotting_delegate.h"
@@ -248,6 +249,9 @@ enum class RendererTerminationTabState {
base::WeakNSProtocol<id<FullScreenControllerDelegate>>
fullScreenControllerDelegate_;
+ // The delegate responsible for headers over the tab.
+ id<TabHeadersDelegate> tabHeadersDelegate_; // weak
+
// The Overscroll controller responsible for displaying the
// overscrollActionsView above the toolbar.
base::scoped_nsobject<OverscrollActionsController>
@@ -527,6 +531,7 @@ void AddNetworkClientFactoryOnIOThread(
@synthesize isVoiceSearchResultsTab = isVoiceSearchResultsTab_;
@synthesize delegate = delegate_;
@synthesize tabSnapshottingDelegate = tabSnapshottingDelegate_;
+@synthesize tabHeadersDelegate = tabHeadersDelegate_;
- (instancetype)initWithWindowName:(NSString*)windowName
opener:(Tab*)opener
@@ -1764,7 +1769,7 @@ void AddNetworkClientFactoryOnIOThread(
// web contents.
CGFloat xOrigin = CGRectGetMidX(self.webState->GetView().frame);
CGFloat yOrigin = CGRectGetMinY(self.webState->GetView().frame) +
- [[self fullScreenControllerDelegate] headerHeight];
+ [[self tabHeadersDelegate] headerHeightForTab:self];
[resubmitDataController_
presentActionSheetFromRect:CGRectMake(xOrigin, yOrigin, 1, 1)
inView:self.webState->GetView()];
@@ -2197,7 +2202,8 @@ void AddNetworkClientFactoryOnIOThread(
}
- (CGFloat)headerHeightForWebController:(CRWWebController*)webController {
- return [fullScreenControllerDelegate_ headerHeight];
+ DCHECK(webController == [self webController]);
+ return [tabHeadersDelegate_ headerHeightForTab:self];
noyau (Ping after 24h) 2017/01/10 13:10:54 Nit: You use [self tabHeadersDelegate] on line 177
Olivier 2017/01/10 18:27:09 Done.
}
- (void)webControllerDidUpdateSSLStatusForCurrentNavigationItem:

Powered by Google App Engine
This is Rietveld 408576698