| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/infobars/core/infobar.h" | 5 #include "components/infobars/core/infobar.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "components/infobars/core/infobar_container.h" | 12 #include "components/infobars/core/infobar_container.h" |
| 13 #include "components/infobars/core/infobar_manager.h" | 13 #include "components/infobars/core/infobar_manager.h" |
| 14 #include "ui/base/material_design/material_design_controller.h" | 14 #include "ui/base/material_design/material_design_controller.h" |
| 15 #include "ui/gfx/animation/slide_animation.h" | 15 #include "ui/gfx/animation/slide_animation.h" |
| 16 | 16 |
| 17 namespace infobars { | 17 namespace infobars { |
| 18 | 18 |
| 19 InfoBar::InfoBar(scoped_ptr<InfoBarDelegate> delegate) | 19 InfoBar::InfoBar(std::unique_ptr<InfoBarDelegate> delegate) |
| 20 : owner_(NULL), | 20 : owner_(NULL), |
| 21 delegate_(std::move(delegate)), | 21 delegate_(std::move(delegate)), |
| 22 container_(NULL), | 22 container_(NULL), |
| 23 animation_(this), | 23 animation_(this), |
| 24 arrow_height_(0), | 24 arrow_height_(0), |
| 25 arrow_target_height_(0), | 25 arrow_target_height_(0), |
| 26 arrow_half_width_(0), | 26 arrow_half_width_(0), |
| 27 bar_height_(0), | 27 bar_height_(0), |
| 28 bar_target_height_(-1) { | 28 bar_target_height_(-1) { |
| 29 DCHECK(delegate_ != NULL); | 29 DCHECK(delegate_ != NULL); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 void InfoBar::MaybeDelete() { | 169 void InfoBar::MaybeDelete() { |
| 170 if (!owner_ && (animation_.GetCurrentValue() == 0.0)) { | 170 if (!owner_ && (animation_.GetCurrentValue() == 0.0)) { |
| 171 if (container_) | 171 if (container_) |
| 172 container_->RemoveInfoBar(this); | 172 container_->RemoveInfoBar(this); |
| 173 delete this; | 173 delete this; |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace infobars | 177 } // namespace infobars |
| OLD | NEW |