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

Unified Diff: chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm

Issue 8477042: Move Sad Tab implementation out of the TabContentsViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changes for jochen and jam Created 9 years, 1 month 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: chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm
diff --git a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm
index c01a9458f809d86c29d4c8a85d9dcaae154db167..5812a8c3c00890b48f4fbcaa9b6321d5301fd3d2 100644
--- a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm
+++ b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm
@@ -7,17 +7,24 @@
#include "base/mac/mac_util.h"
#import "chrome/browser/ui/cocoa/tab_contents/sad_tab_view.h"
+namespace sad_tab_controller_mac {
+
+SadTabController* CreateSadTabController(TabContents* tab_contents) {
+ return [[SadTabController alloc] initWithTabContents:tab_contents];
+}
+
+gfx::NativeView GetViewOfSadTabController(SadTabController* sad_tab) {
+ return [sad_tab view];
+}
+
+} // namespace sad_tab_controller_mac
+
@implementation SadTabController
-- (id)initWithTabContents:(TabContents*)someTabContents
- superview:(NSView*)superview {
+- (id)initWithTabContents:(TabContents*)tabContents {
if ((self = [super initWithNibName:@"SadTab"
bundle:base::mac::MainAppBundle()])) {
- tabContents_ = someTabContents;
-
- NSView* view = [self view];
- [superview addSubview:view];
- [view setFrame:[superview bounds]];
+ tabContents_ = tabContents;
}
return self;
@@ -31,11 +38,6 @@
}
}
-- (void)dealloc {
- [[self view] removeFromSuperview];
- [super dealloc];
-}
-
- (TabContents*)tabContents {
return tabContents_;
}

Powered by Google App Engine
This is Rietveld 408576698