OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 5 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "chrome/browser/extensions/extension_view_host.h" | 10 #include "chrome/browser/extensions/extension_view_host.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 : browser_(browser), | 27 : browser_(browser), |
28 extension_host_(extension_host), | 28 extension_host_(extension_host), |
29 container_(NULL) { | 29 container_(NULL) { |
30 DCHECK(extension_host_); | 30 DCHECK(extension_host_); |
31 [GetNativeView() setHidden:YES]; | 31 [GetNativeView() setHidden:YES]; |
32 } | 32 } |
33 | 33 |
34 ExtensionViewMac::~ExtensionViewMac() { | 34 ExtensionViewMac::~ExtensionViewMac() { |
35 } | 35 } |
36 | 36 |
37 void ExtensionViewMac::WindowFrameChanged() { | |
38 if (render_view_host()->GetWidget()->GetView()) | |
39 render_view_host()->GetWidget()->GetView()->WindowFrameChanged(); | |
40 } | |
41 | |
42 void ExtensionViewMac::CreateWidgetHostViewIn(gfx::NativeView superview) { | 37 void ExtensionViewMac::CreateWidgetHostViewIn(gfx::NativeView superview) { |
43 [superview addSubview:GetNativeView()]; | 38 [superview addSubview:GetNativeView()]; |
44 extension_host_->CreateRenderViewSoon(); | 39 extension_host_->CreateRenderViewSoon(); |
45 } | 40 } |
46 | 41 |
47 Browser* ExtensionViewMac::GetBrowser() { | 42 Browser* ExtensionViewMac::GetBrowser() { |
48 return browser_; | 43 return browser_; |
49 } | 44 } |
50 | 45 |
51 gfx::NativeView ExtensionViewMac::GetNativeView() { | 46 gfx::NativeView ExtensionViewMac::GetNativeView() { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 namespace extensions { | 100 namespace extensions { |
106 | 101 |
107 // static | 102 // static |
108 scoped_ptr<ExtensionView> ExtensionViewHost::CreateExtensionView( | 103 scoped_ptr<ExtensionView> ExtensionViewHost::CreateExtensionView( |
109 ExtensionViewHost* host, | 104 ExtensionViewHost* host, |
110 Browser* browser) { | 105 Browser* browser) { |
111 return make_scoped_ptr(new ExtensionViewMac(host, browser)); | 106 return make_scoped_ptr(new ExtensionViewMac(host, browser)); |
112 } | 107 } |
113 | 108 |
114 } // namespace extensions | 109 } // namespace extensions |
OLD | NEW |