| 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" |
| 11 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 11 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
| 12 #include "chrome/browser/extensions/image_loader.h" | 12 #include "chrome/browser/extensions/image_loader.h" |
| 13 #include "chrome/browser/ui/browser_finder.h" | 13 #include "chrome/browser/ui/browser_finder.h" |
| 14 #import "chrome/browser/ui/cocoa/animatable_view.h" | 14 #import "chrome/browser/ui/cocoa/animatable_view.h" |
| 15 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" | 15 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" |
| 16 #include "chrome/browser/ui/cocoa/infobars/infobar.h" | 16 #include "chrome/browser/ui/cocoa/infobars/infobar.h" |
| 17 #import "chrome/browser/ui/cocoa/menu_button.h" | 17 #import "chrome/browser/ui/cocoa/menu_button.h" |
| 18 #include "chrome/common/extensions/extension.h" | 18 #include "chrome/common/extensions/extension.h" |
| 19 #include "chrome/common/extensions/extension_constants.h" | 19 #include "chrome/common/extensions/extension_constants.h" |
| 20 #include "chrome/common/extensions/extension_icon_set.h" | 20 #include "chrome/common/extensions/extension_icon_set.h" |
| 21 #include "chrome/common/extensions/extension_resource.h" | 21 #include "chrome/common/extensions/extension_resource.h" |
| 22 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 23 #include "content/public/browser/web_contents_view.h" |
| 23 #include "grit/theme_resources.h" | 24 #include "grit/theme_resources.h" |
| 24 #include "skia/ext/skia_utils_mac.h" | 25 #include "skia/ext/skia_utils_mac.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/gfx/canvas.h" | 27 #include "ui/gfx/canvas.h" |
| 27 #include "ui/gfx/image/image.h" | 28 #include "ui/gfx/image/image.h" |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 const CGFloat kAnimationDuration = 0.12; | 31 const CGFloat kAnimationDuration = 0.12; |
| 31 const CGFloat kBottomBorderHeightPx = 1.0; | 32 const CGFloat kBottomBorderHeightPx = 1.0; |
| 32 const CGFloat kButtonHeightPx = 26.0; | 33 const CGFloat kButtonHeightPx = 26.0; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } | 266 } |
| 266 | 267 |
| 267 - (void)setButtonImage:(NSImage*)image { | 268 - (void)setButtonImage:(NSImage*)image { |
| 268 [dropdownButton_ setImage:image]; | 269 [dropdownButton_ setImage:image]; |
| 269 } | 270 } |
| 270 | 271 |
| 271 @end | 272 @end |
| 272 | 273 |
| 273 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { | 274 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { |
| 274 NSWindow* window = | 275 NSWindow* window = |
| 275 [(NSView*)owner->GetWebContents()->GetContentNativeView() window]; | 276 [(NSView*)owner->GetWebContents()->GetView()->GetContentNativeView() |
| 277 window]; |
| 276 ExtensionInfoBarController* controller = | 278 ExtensionInfoBarController* controller = |
| 277 [[ExtensionInfoBarController alloc] initWithDelegate:this | 279 [[ExtensionInfoBarController alloc] initWithDelegate:this |
| 278 owner:owner | 280 owner:owner |
| 279 window:window]; | 281 window:window]; |
| 280 return new InfoBar(controller, this); | 282 return new InfoBar(controller, this); |
| 281 } | 283 } |
| OLD | NEW |