Commit 3b94cb81 authored by Ayu Ishii's avatar Ayu Ishii Committed by Commit Bot

Change TabStyle to return unique_ptr instead of raw pointers.

Bug: 916176
Change-Id: Ic2ff27655cec1a3ec4991a468710449b62457d80
Reviewed-on: https://chromium-review.googlesource.com/c/1392272Reviewed-by: default avatarClark DuVall <cduvall@chromium.org>
Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622050}
parent cced1867
......@@ -128,7 +128,7 @@ Tab::Tab(TabController* controller, gfx::AnimationContainer* container)
hover_controller_(this) {
DCHECK(controller);
tab_style_.reset(TabStyle::CreateForTab(this));
tab_style_ = TabStyle::CreateForTab(this);
// So we get don't get enter/exit on children and don't prematurely stop the
// hover.
......
......@@ -764,8 +764,8 @@ gfx::RectF GM2TabStyle::ScaleAndAlignBounds(const gfx::Rect& bounds,
TabStyle::~TabStyle() = default;
// static
TabStyle* TabStyle::CreateForTab(const Tab* tab) {
return new GM2TabStyle(tab);
std::unique_ptr<TabStyle> TabStyle::CreateForTab(const Tab* tab) {
return std::make_unique<GM2TabStyle>(tab);
}
// static
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_STYLE_H_
#define CHROME_BROWSER_UI_VIEWS_TABS_TAB_STYLE_H_
#include <memory>
#include "base/macros.h"
#include "ui/gfx/geometry/rect_f.h"
......@@ -72,7 +74,7 @@ class TabStyle {
// We've implemented this as a factory function so that when we're playing
// with new variatons on tab shapes we can have a few possible implementations
// and switch them in one place.
static TabStyle* CreateForTab(const Tab* tab);
static std::unique_ptr<TabStyle> CreateForTab(const Tab* tab);
virtual ~TabStyle();
......
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