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 #include "chrome/browser/ui/views/infobars/confirm_infobar.h" | 5 #include "chrome/browser/ui/views/infobars/confirm_infobar.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | |
9 #include "chrome/browser/ui/views/elevation_icon_setter.h" | 8 #include "chrome/browser/ui/views/elevation_icon_setter.h" |
| 9 #include "components/infobars/core/confirm_infobar_delegate.h" |
10 #include "ui/base/window_open_disposition.h" | 10 #include "ui/base/window_open_disposition.h" |
11 #include "ui/views/controls/button/label_button.h" | 11 #include "ui/views/controls/button/label_button.h" |
12 #include "ui/views/controls/label.h" | 12 #include "ui/views/controls/label.h" |
13 #include "ui/views/controls/link.h" | 13 #include "ui/views/controls/link.h" |
14 | 14 |
15 | 15 |
16 // ConfirmInfoBarDelegate ----------------------------------------------------- | 16 // ConfirmInfoBarDelegate ----------------------------------------------------- |
17 | 17 |
18 // static | 18 // static |
19 scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( | 19 scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 } | 127 } |
128 | 128 |
129 int ConfirmInfoBar::NonLabelWidth() const { | 129 int ConfirmInfoBar::NonLabelWidth() const { |
130 int width = (label_->text().empty() || (!ok_button_ && !cancel_button_)) ? | 130 int width = (label_->text().empty() || (!ok_button_ && !cancel_button_)) ? |
131 0 : kEndOfLabelSpacing; | 131 0 : kEndOfLabelSpacing; |
132 if (ok_button_) | 132 if (ok_button_) |
133 width += ok_button_->width() + (cancel_button_ ? kButtonButtonSpacing : 0); | 133 width += ok_button_->width() + (cancel_button_ ? kButtonButtonSpacing : 0); |
134 width += (cancel_button_ ? cancel_button_->width() : 0); | 134 width += (cancel_button_ ? cancel_button_->width() : 0); |
135 return width + ((link_->text().empty() || !width) ? 0 : kEndOfLabelSpacing); | 135 return width + ((link_->text().empty() || !width) ? 0 : kEndOfLabelSpacing); |
136 } | 136 } |
OLD | NEW |