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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/tabs/tab_strip_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index b08f9359b50d2b3aa35a8ab87bdec870d04e6061..d231b3494dc168a69cfa5232f4ea35a2ca6a5947 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -689,7 +689,7 @@ TabStrip::TabStrip(TabStripController* controller)
immersive_style_(false) {
Init();
SetEventTargeter(
- scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
+ std::unique_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
}
TabStrip::~TabStrip() {
@@ -1708,8 +1708,8 @@ void TabStrip::Init() {
l10n_util::GetStringUTF16(IDS_ACCNAME_NEWTAB));
newtab_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT,
views::ImageButton::ALIGN_BOTTOM);
- newtab_button_->SetEventTargeter(
- scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(newtab_button_)));
+ newtab_button_->SetEventTargeter(std::unique_ptr<views::ViewTargeter>(
+ new views::ViewTargeter(newtab_button_)));
AddChildView(newtab_button_);
if (drop_indicator_width == 0) {
@@ -1770,9 +1770,9 @@ void TabStrip::ScheduleRemoveTabAnimation(Tab* tab) {
gfx::Rect tab_bounds = tab->bounds();
tab_bounds.set_width(0);
bounds_animator_.AnimateViewTo(tab, tab_bounds);
- bounds_animator_.SetAnimationDelegate(
- tab,
- scoped_ptr<gfx::AnimationDelegate>(new RemoveTabDelegate(this, tab)));
+ bounds_animator_.SetAnimationDelegate(tab,
+ std::unique_ptr<gfx::AnimationDelegate>(
+ new RemoveTabDelegate(this, tab)));
// Don't animate the new tab button when dragging tabs. Otherwise it looks
// like the new tab button magically appears from beyond the end of the tab
@@ -1789,9 +1789,8 @@ void TabStrip::AnimateToIdealBounds() {
if (!tab->dragging()) {
bounds_animator_.AnimateViewTo(tab, ideal_bounds(i));
bounds_animator_.SetAnimationDelegate(
- tab,
- scoped_ptr<gfx::AnimationDelegate>(
- new TabAnimationDelegate(this, tab)));
+ tab, std::unique_ptr<gfx::AnimationDelegate>(
+ new TabAnimationDelegate(this, tab)));
}
}
@@ -2030,7 +2029,7 @@ void TabStrip::RemoveTabFromViewModel(int index) {
}
void TabStrip::RemoveAndDeleteTab(Tab* tab) {
- scoped_ptr<Tab> deleter(tab);
+ std::unique_ptr<Tab> deleter(tab);
FindClosingTabResult res(FindClosingTab(tab));
res.first->second.erase(res.second);
if (res.first->second.empty())
@@ -2138,9 +2137,8 @@ void TabStrip::StoppedDraggingTab(Tab* tab, bool* is_first_tab) {
// Install a delegate to reset the dragging state when done. We have to leave
// dragging true for the tab otherwise it'll draw beneath the new tab button.
bounds_animator_.SetAnimationDelegate(
- tab,
- scoped_ptr<gfx::AnimationDelegate>(
- new ResetDraggingStateDelegate(this, tab)));
+ tab, std::unique_ptr<gfx::AnimationDelegate>(
+ new ResetDraggingStateDelegate(this, tab)));
}
void TabStrip::OwnDragController(TabDragController* controller) {
@@ -2592,9 +2590,8 @@ void TabStrip::StartMouseInitiatedRemoveTabAnimation(int model_index) {
// Register delegate to do cleanup when done, BoundsAnimator takes
// ownership of RemoveTabDelegate.
bounds_animator_.SetAnimationDelegate(
- tab_closing,
- scoped_ptr<gfx::AnimationDelegate>(
- new RemoveTabDelegate(this, tab_closing)));
+ tab_closing, std::unique_ptr<gfx::AnimationDelegate>(
+ new RemoveTabDelegate(this, tab_closing)));
}
bool TabStrip::IsPointInTab(Tab* tab,
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/tabs/tab_strip_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698