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