| 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/api/infobars/infobar_service.h" | 9 #include "chrome/browser/api/infobars/infobar_service.h" |
| 10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 owner:(InfoBarService*)owner | 143 owner:(InfoBarService*)owner |
| 144 window:(NSWindow*)window { | 144 window:(NSWindow*)window { |
| 145 if ((self = [super initWithDelegate:delegate owner:owner])) { | 145 if ((self = [super initWithDelegate:delegate owner:owner])) { |
| 146 window_ = window; | 146 window_ = window; |
| 147 dropdownButton_.reset([[MenuButton alloc] init]); | 147 dropdownButton_.reset([[MenuButton alloc] init]); |
| 148 [dropdownButton_ setOpenMenuOnClick:YES]; | 148 [dropdownButton_ setOpenMenuOnClick:YES]; |
| 149 | 149 |
| 150 extensions::ExtensionHost* extensionHost = | 150 extensions::ExtensionHost* extensionHost = |
| 151 delegate_->AsExtensionInfoBarDelegate()->extension_host(); | 151 delegate_->AsExtensionInfoBarDelegate()->extension_host(); |
| 152 Browser* browser = | 152 Browser* browser = |
| 153 browser::FindBrowserWithWebContents(owner->GetWebContents()); | 153 chrome::FindBrowserWithWebContents(owner->GetWebContents()); |
| 154 contextMenu_.reset([[ExtensionActionContextMenu alloc] | 154 contextMenu_.reset([[ExtensionActionContextMenu alloc] |
| 155 initWithExtension:extensionHost->extension() | 155 initWithExtension:extensionHost->extension() |
| 156 browser:browser | 156 browser:browser |
| 157 extensionAction:NULL]); | 157 extensionAction:NULL]); |
| 158 // See menu_button.h for documentation on why this is needed. | 158 // See menu_button.h for documentation on why this is needed. |
| 159 NSMenuItem* dummyItem = | 159 NSMenuItem* dummyItem = |
| 160 [[[NSMenuItem alloc] initWithTitle:@"" | 160 [[[NSMenuItem alloc] initWithTitle:@"" |
| 161 action:nil | 161 action:nil |
| 162 keyEquivalent:@""] autorelease]; | 162 keyEquivalent:@""] autorelease]; |
| 163 [contextMenu_ insertItem:dummyItem atIndex:0]; | 163 [contextMenu_ insertItem:dummyItem atIndex:0]; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { | 275 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { |
| 276 NSWindow* window = | 276 NSWindow* window = |
| 277 [(NSView*)owner->GetWebContents()->GetContentNativeView() window]; | 277 [(NSView*)owner->GetWebContents()->GetContentNativeView() window]; |
| 278 ExtensionInfoBarController* controller = | 278 ExtensionInfoBarController* controller = |
| 279 [[ExtensionInfoBarController alloc] initWithDelegate:this | 279 [[ExtensionInfoBarController alloc] initWithDelegate:this |
| 280 owner:owner | 280 owner:owner |
| 281 window:window]; | 281 window:window]; |
| 282 return new InfoBar(controller, this); | 282 return new InfoBar(controller, this); |
| 283 } | 283 } |
| OLD | NEW |