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 #import "chrome/browser/ui/cocoa/infobars/extension_infobar_controller.h" | 5 #import "chrome/browser/ui/cocoa/infobars/extension_infobar_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
10 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 10 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 @implementation ExtensionInfoBarController | 139 @implementation ExtensionInfoBarController |
140 | 140 |
141 - (id)initWithDelegate:(InfoBarDelegate*)delegate | 141 - (id)initWithDelegate:(InfoBarDelegate*)delegate |
142 owner:(InfoBarTabHelper*)owner | 142 owner:(InfoBarTabHelper*)owner |
143 window:(NSWindow*)window { | 143 window:(NSWindow*)window { |
144 if ((self = [super initWithDelegate:delegate owner:owner])) { | 144 if ((self = [super initWithDelegate:delegate owner:owner])) { |
145 window_ = window; | 145 window_ = window; |
146 dropdownButton_.reset([[MenuButton alloc] init]); | 146 dropdownButton_.reset([[MenuButton alloc] init]); |
147 [dropdownButton_ setOpenMenuOnClick:YES]; | 147 [dropdownButton_ setOpenMenuOnClick:YES]; |
148 | 148 |
149 ExtensionHost* extensionHost = delegate_->AsExtensionInfoBarDelegate()-> | 149 extensions::ExtensionHost* extensionHost = |
150 extension_host(); | 150 delegate_->AsExtensionInfoBarDelegate()->extension_host(); |
151 Browser* browser = | 151 Browser* browser = |
152 browser::FindBrowserWithWebContents(owner->web_contents()); | 152 browser::FindBrowserWithWebContents(owner->web_contents()); |
153 contextMenu_.reset([[ExtensionActionContextMenu alloc] | 153 contextMenu_.reset([[ExtensionActionContextMenu alloc] |
154 initWithExtension:extensionHost->extension() | 154 initWithExtension:extensionHost->extension() |
155 browser:browser | 155 browser:browser |
156 extensionAction:NULL]); | 156 extensionAction:NULL]); |
157 // See menu_button.h for documentation on why this is needed. | 157 // See menu_button.h for documentation on why this is needed. |
158 NSMenuItem* dummyItem = | 158 NSMenuItem* dummyItem = |
159 [[[NSMenuItem alloc] initWithTitle:@"" | 159 [[[NSMenuItem alloc] initWithTitle:@"" |
160 action:nil | 160 action:nil |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { | 274 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { |
275 NSWindow* window = | 275 NSWindow* window = |
276 [(NSView*)owner->web_contents()->GetContentNativeView() window]; | 276 [(NSView*)owner->web_contents()->GetContentNativeView() window]; |
277 ExtensionInfoBarController* controller = | 277 ExtensionInfoBarController* controller = |
278 [[ExtensionInfoBarController alloc] initWithDelegate:this | 278 [[ExtensionInfoBarController alloc] initWithDelegate:this |
279 owner:owner | 279 owner:owner |
280 window:window]; | 280 window:window]; |
281 return new InfoBar(controller, this); | 281 return new InfoBar(controller, this); |
282 } | 282 } |
OLD | NEW |