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 SadTabCocoa(content::WebContents* web_contents, chrome::SadTabKind kind) |
| 14 : SadTab(web_contents, kind) { |
| 15 NSView* web_contents_view = web_contents->GetNativeView(); |
| 16 sad_tab_view_ = |
| 17 [[SadTabView alloc] initWithFrame:web_contents_view.bounds sadTab:this]; |
| 18 [web_contents_view addSubview:sad_tab_view_]; |
| 19 [sad_tab_view_ release]; |
| 20 } |
| 21 |
| 22 ~SadTabCocoa() override { [sad_tab_view_ removeFromSuperview]; } |
| 23 |
| 24 private: |
| 25 // Owned by web_contents |
| 26 SadTabView* sad_tab_view_; |
| 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 |