Commit ffb3dcff authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev Committed by Commit Bot

Replace new with std::make_unique under ash/app_list

Bug: None
Test: compile locally
Change-Id: Ie32578e191b09c1c1ba5e0f298bbd11dcc54ec76
Reviewed-on: https://chromium-review.googlesource.com/1150869
Commit-Queue: Vladislav Kaznacheev <kaznacheev@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581401}
parent 7acc0647
......@@ -236,7 +236,7 @@ void PaginationModel::StartTransitionAnimation(const Transition& transition) {
NotifyTransitionStarted();
SetTransition(transition);
transition_animation_.reset(new gfx::SlideAnimation(this));
transition_animation_ = std::make_unique<gfx::SlideAnimation>(this);
transition_animation_->SetDampeningValue(kPageTransitionDurationDampening);
transition_animation_->SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN);
transition_animation_->Reset(transition_.progress);
......
......@@ -48,7 +48,7 @@ class GridViewVisibleWaiter {
check_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(50),
base::Bind(&GridViewVisibleWaiter::OnTimerCheck,
base::Unretained(this)));
run_loop_.reset(new base::RunLoop);
run_loop_ = std::make_unique<base::RunLoop>();
run_loop_->Run();
check_timer_.Stop();
}
......@@ -82,7 +82,7 @@ class AppListMainViewTest : public views::ViewsTestBase {
// list (http://crbug.com/759779).
views::ViewsTestBase::SetUp();
#if 0
delegate_.reset(new AppListTestViewDelegate);
delegate_ = std::make_unique<AppListTestViewDelegate>();
main_view_ = new AppListMainView(delegate_.get(), nullptr);
main_view_->SetPaintToLayer();
......
......@@ -143,7 +143,7 @@ class AppListViewTest : public views::ViewsTestBase,
void Initialize(int initial_apps_page,
bool is_tablet_mode,
bool is_side_shelf) {
delegate_.reset(new AppListTestViewDelegate);
delegate_ = std::make_unique<AppListTestViewDelegate>();
view_ = new AppListView(delegate_.get());
AppListView::InitParams params;
params.parent = GetContext();
......@@ -270,7 +270,7 @@ class AppListViewFocusTest : public views::ViewsTestBase,
}
// Initialize app list view.
delegate_.reset(new AppListTestViewDelegate);
delegate_ = std::make_unique<AppListTestViewDelegate>();
view_ = new AppListView(delegate_.get());
AppListView::InitParams params;
params.parent = GetContext();
......
......@@ -321,7 +321,7 @@ AppsGridView::AppsGridView(ContentsView* contents_view,
if (features::IsBackgroundBlurEnabled()) {
// TODO(newcomer): Improve implementation of the mask layer so we can
// enable it on all devices crbug.com/765292.
fadeout_layer_delegate_.reset(new FadeoutLayerDelegate);
fadeout_layer_delegate_ = std::make_unique<FadeoutLayerDelegate>();
layer()->SetMaskLayer(fadeout_layer_delegate_->layer());
}
......@@ -335,10 +335,10 @@ AppsGridView::AppsGridView(ContentsView* contents_view,
pagination_model_.AddObserver(this);
pagination_controller_.reset(new PaginationController(
pagination_controller_ = std::make_unique<PaginationController>(
&pagination_model_, folder_delegate_
? PaginationController::SCROLL_AXIS_HORIZONTAL
: PaginationController::SCROLL_AXIS_VERTICAL));
: PaginationController::SCROLL_AXIS_VERTICAL);
}
AppsGridView::~AppsGridView() {
......
......@@ -70,7 +70,7 @@ class PageFlipWaiter : public PaginationModelObserver {
DCHECK(!wait_);
wait_ = true;
ui_run_loop_.reset(new base::RunLoop);
ui_run_loop_ = std::make_unique<base::RunLoop>();
ui_run_loop_->Run();
wait_ = false;
}
......@@ -212,7 +212,7 @@ class AppsGridViewTest : public views::ViewsTestBase,
gfx::NativeView parent = GetContext();
// Ensure that parent is big enough to show the full AppListView.
parent->SetBounds(gfx::Rect(gfx::Point(0, 0), gfx::Size(1024, 768)));
delegate_.reset(new AppListTestViewDelegate);
delegate_ = std::make_unique<AppListTestViewDelegate>();
app_list_view_ = new AppListView(delegate_.get());
AppListView::InitParams params;
params.parent = parent;
......@@ -241,7 +241,7 @@ class AppsGridViewTest : public views::ViewsTestBase,
app_list_view_->SetState(AppListViewState::FULLSCREEN_ALL_APPS);
app_list_view_->Layout();
test_api_.reset(new AppsGridViewTestApi(apps_grid_view_));
test_api_ = std::make_unique<AppsGridViewTestApi>(apps_grid_view_);
}
void TearDown() override {
app_list_view_->GetWidget()->Close();
......
......@@ -108,7 +108,7 @@ ExpandArrowView::ExpandArrowView(ContentsView* contents_view,
SetAccessibleName(l10n_util::GetStringUTF16(IDS_APP_LIST_EXPAND_BUTTON));
animation_.reset(new gfx::SlideAnimation(this));
animation_ = std::make_unique<gfx::SlideAnimation>(this);
animation_->SetTweenType(gfx::Tween::LINEAR);
animation_->SetSlideDuration(kCycleDurationInMs * 2 + kCycleIntervalInMs);
ResetHintingAnimation();
......
......@@ -23,8 +23,8 @@ HorizontalPageContainer::HorizontalPageContainer(ContentsView* contents_view,
pagination_model_.SetTransitionDurations(kPageTransitionDurationInMs,
kOverscrollPageTransitionDurationMs);
pagination_model_.AddObserver(this);
pagination_controller_.reset(new PaginationController(
&pagination_model_, PaginationController::SCROLL_AXIS_HORIZONTAL));
pagination_controller_ = std::make_unique<PaginationController>(
&pagination_model_, PaginationController::SCROLL_AXIS_HORIZONTAL);
// Add horizontal pages.
apps_container_view_ = new AppsContainerView(contents_view_, model);
......
......@@ -70,7 +70,8 @@ class SearchBoxViewTest : public views::test::WidgetTest,
app_list_view()->Initialize(params);
widget_ = CreateTopLevelPlatformWidget();
view_.reset(new SearchBoxView(this, &view_delegate_, app_list_view()));
view_ =
std::make_unique<SearchBoxView>(this, &view_delegate_, app_list_view());
view_->Init();
widget_->SetBounds(gfx::Rect(0, 0, 300, 200));
counter_view_ = new KeyPressCounterView(app_list_view_);
......
......@@ -36,7 +36,7 @@ class SearchResultListViewTest : public views::ViewsTestBase {
// Overridden from testing::Test:
void SetUp() override {
views::ViewsTestBase::SetUp();
view_.reset(new SearchResultListView(nullptr, &view_delegate_));
view_ = std::make_unique<SearchResultListView>(nullptr, &view_delegate_);
view_->SetResults(view_delegate_.GetSearchModel()->results());
}
......
......@@ -66,7 +66,7 @@ class SearchResultPageViewTest
ASSERT_EQ(test_with_answer_card, features::IsAnswerCardEnabled());
// Setting up views.
delegate_.reset(new AppListTestViewDelegate);
delegate_ = std::make_unique<AppListTestViewDelegate>();
app_list_view_ = new AppListView(delegate_.get());
AppListView::InitParams params;
params.parent = GetContext();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment