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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 0, 0, image_size, image_size, | 111 0, 0, image_size, image_size, |
112 false); | 112 false); |
113 canvas->DrawImageInt(*drop_image, | 113 canvas->DrawImageInt(*drop_image, |
114 image_size + kDropArrowLeftMarginPx, | 114 image_size + kDropArrowLeftMarginPx, |
115 image_size / 2); | 115 image_size / 2); |
116 [owner_ setButtonImage:gfx::SkBitmapToNSImage( | 116 [owner_ setButtonImage:gfx::SkBitmapToNSImage( |
117 canvas->ExtractImageRep().sk_bitmap())]; | 117 canvas->ExtractImageRep().sk_bitmap())]; |
118 } | 118 } |
119 | 119 |
120 // Overridden from ExtensionInfoBarDelegate::DelegateObserver: | 120 // Overridden from ExtensionInfoBarDelegate::DelegateObserver: |
121 virtual void OnDelegateDeleted() { | 121 virtual void OnDelegateDeleted() OVERRIDE { |
122 delegate_ = NULL; | 122 delegate_ = NULL; |
123 } | 123 } |
124 | 124 |
125 private: | 125 private: |
126 // Weak. Owns us. | 126 // Weak. Owns us. |
127 ExtensionInfoBarController* owner_; | 127 ExtensionInfoBarController* owner_; |
128 | 128 |
129 // Weak. | 129 // Weak. |
130 ExtensionInfoBarDelegate* delegate_; | 130 ExtensionInfoBarDelegate* delegate_; |
131 | 131 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { | 273 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { |
274 NSWindow* window = | 274 NSWindow* window = |
275 [(NSView*)owner->GetWebContents()->GetContentNativeView() window]; | 275 [(NSView*)owner->GetWebContents()->GetContentNativeView() window]; |
276 ExtensionInfoBarController* controller = | 276 ExtensionInfoBarController* controller = |
277 [[ExtensionInfoBarController alloc] initWithDelegate:this | 277 [[ExtensionInfoBarController alloc] initWithDelegate:this |
278 owner:owner | 278 owner:owner |
279 window:window]; | 279 window:window]; |
280 return new InfoBar(controller, this); | 280 return new InfoBar(controller, this); |
281 } | 281 } |
OLD | NEW |