OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #import "chrome/browser/ui/cocoa/tab_contents/sad_tab_view_cocoa.h" | |
6 #include "chrome/browser/ui/sad_tab.h" | |
7 #include "content/public/browser/web_contents.h" | |
8 | |
9 namespace { | |
10 | |
11 class SadTabCocoa : public chrome::SadTab { | |
12 public: | |
13 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
| |
14 chrome::SadTabKind kind) | |
15 : SadTab(web_contents, kind) { | |
16 NSView* web_contents_view = web_contents->GetNativeView(); | |
17 sad_tab_view_ = | |
18 [[SadTabView alloc] initWithFrame:web_contents_view.bounds sadTab:this]; | |
19 [web_contents_view addSubview:sad_tab_view_]; | |
20 [sad_tab_view_ release]; | |
21 } | |
22 | |
23 ~SadTabCocoa() override { [sad_tab_view_ removeFromSuperview]; } | |
24 | |
25 private: | |
26 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
| |
27 }; | |
28 | |
29 } // namespace | |
30 | |
31 chrome::SadTab* chrome::SadTab::Create(content::WebContents* web_contents, | |
32 SadTabKind kind) { | |
33 return new SadTabCocoa(web_contents, kind); | |
34 } | |
OLD | NEW |