OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/infobars/infobar_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" |
6 | 6 |
| 7 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" |
| 8 |
7 const int InfoBar::kSeparatorLineHeight = 1; | 9 const int InfoBar::kSeparatorLineHeight = 1; |
8 const int InfoBar::kDefaultArrowTargetHeight = 11; | 10 const int InfoBar::kDefaultArrowTargetHeight = 11; |
9 const int InfoBar::kMaximumArrowTargetHeight = 24; | 11 const int InfoBar::kMaximumArrowTargetHeight = 24; |
10 const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight; | 12 const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight; |
11 const int InfoBar::kMaximumArrowTargetHalfWidth = 14; | 13 const int InfoBar::kMaximumArrowTargetHalfWidth = 14; |
12 const int InfoBar::kDefaultBarTargetHeight = 36; | 14 const int InfoBar::kDefaultBarTargetHeight = 36; |
13 | 15 |
14 InfoBarCocoa::InfoBarCocoa(InfoBarService* owner, InfoBarDelegate* delegate) | 16 InfoBarCocoa::InfoBarCocoa(scoped_ptr<InfoBarDelegate> delegate) |
15 : InfoBar(owner, delegate), | 17 : InfoBar(delegate.Pass()), |
16 weak_ptr_factory_(this) { | 18 weak_ptr_factory_(this) { |
17 } | 19 } |
18 | 20 |
19 InfoBarCocoa::~InfoBarCocoa() { | 21 InfoBarCocoa::~InfoBarCocoa() { |
20 } | 22 if (controller()) |
21 | 23 [controller() infobarWillClose]; |
22 void InfoBarCocoa::RemoveSelfCocoa() { | |
23 RemoveSelf(); | |
24 } | 24 } |
25 | 25 |
26 InfoBarService* InfoBarCocoa::OwnerCocoa() { | 26 InfoBarService* InfoBarCocoa::OwnerCocoa() { |
27 return owner(); | 27 return owner(); |
28 } | 28 } |
29 | 29 |
30 base::WeakPtr<InfoBarCocoa> InfoBarCocoa::GetWeakPtr() { | 30 base::WeakPtr<InfoBarCocoa> InfoBarCocoa::GetWeakPtr() { |
31 return weak_ptr_factory_.GetWeakPtr(); | 31 return weak_ptr_factory_.GetWeakPtr(); |
32 } | 32 } |
OLD | NEW |