Chromium Code Reviews| Index: chrome/browser/ui/cocoa/tab_contents/sad_tab_mac.mm |
| diff --git a/chrome/browser/ui/cocoa/tab_contents/sad_tab_mac.mm b/chrome/browser/ui/cocoa/tab_contents/sad_tab_mac.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c8d2f1cb8f60a57d6d18b8fd1a89b6184c129393 |
| --- /dev/null |
| +++ b/chrome/browser/ui/cocoa/tab_contents/sad_tab_mac.mm |
| @@ -0,0 +1,34 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#import "chrome/browser/ui/cocoa/tab_contents/sad_tab_view_cocoa.h" |
| +#include "chrome/browser/ui/sad_tab.h" |
| +#include "content/public/browser/web_contents.h" |
| + |
| +namespace { |
| + |
| +class SadTabCocoa : public chrome::SadTab { |
| + public: |
| + explicit SadTabCocoa(content::WebContents* web_contents, |
|
Nico
2016/08/30 22:49:10
we don't usually use explicit on ctors with != 1 a
Sidney San Martín
2016/08/30 23:06:47
I think the explicit may have been a holdover from
|
| + chrome::SadTabKind kind) |
| + : SadTab(web_contents, kind) { |
| + NSView* web_contents_view = web_contents->GetNativeView(); |
| + sad_tab_view_ = |
| + [[SadTabView alloc] initWithFrame:web_contents_view.bounds sadTab:this]; |
| + [web_contents_view addSubview:sad_tab_view_]; |
| + [sad_tab_view_ release]; |
| + } |
| + |
| + ~SadTabCocoa() override { [sad_tab_view_ removeFromSuperview]; } |
| + |
| + private: |
| + SadTabView* sad_tab_view_; |
|
Nico
2016/08/30 22:49:10
add "// Owned by web_contents", comment why that's
Sidney San Martín
2016/08/30 23:06:47
I'll add a comment on ownership. The destructor us
|
| +}; |
| + |
| +} // namespace |
| + |
| +chrome::SadTab* chrome::SadTab::Create(content::WebContents* web_contents, |
| + SadTabKind kind) { |
| + return new SadTabCocoa(web_contents, kind); |
| +} |