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

Unified Diff: chrome/browser/background/background_mode_manager.cc

Issue 2767893002: Remove ScopedVector from chrome/browser/. (Closed)
Patch Set: Created 3 years, 9 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
Index: chrome/browser/background/background_mode_manager.cc
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
index ac7cc8f6cacc4f6a25977e6faf684f1c9bc9f448..ccad4f9167e5db8f677143fef97f5c00ccd1a214 100644
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -16,6 +16,7 @@
#include "base/command_line.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
@@ -975,11 +976,10 @@ void BackgroundModeManager::UpdateStatusTrayIconContextMenu() {
// We should only display the profile in the status icon if it has at
// least one background app.
if (bmd->GetBackgroundClientCount() > 0) {
- StatusIconMenuModel* submenu = new StatusIconMenuModel(bmd);
// The submenu constructor caller owns the lifetime of the submenu.
// The containing menu does not handle the lifetime.
- submenus.push_back(submenu);
- bmd->BuildProfileMenu(submenu, menu.get());
+ submenus.push_back(base::MakeUnique<StatusIconMenuModel>(bmd));
+ bmd->BuildProfileMenu(submenus.back().get(), menu.get());
profiles_using_background_mode++;
}
}

Powered by Google App Engine
This is Rietveld 408576698