Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: components/infobars/core/infobar.cc

Issue 1918083002: Convert //components/[f-n]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: … Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/infobars/core/infobar.h ('k') | components/infobars/core/infobar_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/infobars/core/infobar.h ('k') | components/infobars/core/infobar_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698