Commit 4af48586 authored by dcheng's avatar dcheng Committed by Commit bot
Browse files

Convert //chrome/browser from scoped_ptr to std::unique_ptr

BUG=554298

Review URL: https://codereview.chromium.org/1902583002

Cr-Commit-Position: refs/heads/master@{#388093}
parent 85719a9f
......@@ -4,11 +4,12 @@
#include "chrome/browser/after_startup_task_utils.h"
#include <memory>
#include <utility>
#include "base/lazy_instance.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/process/process_info.h"
#include "base/rand_util.h"
......@@ -57,13 +58,13 @@ bool IsBrowserStartupComplete() {
return g_startup_complete_flag.Get().IsSet();
}
void RunTask(scoped_ptr<AfterStartupTask> queued_task) {
void RunTask(std::unique_ptr<AfterStartupTask> queued_task) {
// We're careful to delete the caller's |task| on the target runner's thread.
DCHECK(queued_task->task_runner->RunsTasksOnCurrentThread());
queued_task->task.Run();
}
void ScheduleTask(scoped_ptr<AfterStartupTask> queued_task) {
void ScheduleTask(std::unique_ptr<AfterStartupTask> queued_task) {
// Spread their execution over a brief time.
const int kMinDelaySec = 0;
const int kMaxDelaySec = 10;
......@@ -74,7 +75,7 @@ void ScheduleTask(scoped_ptr<AfterStartupTask> queued_task) {
base::TimeDelta::FromSeconds(base::RandInt(kMinDelaySec, kMaxDelaySec)));
}
void QueueTask(scoped_ptr<AfterStartupTask> queued_task) {
void QueueTask(std::unique_ptr<AfterStartupTask> queued_task) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
......@@ -106,7 +107,7 @@ void SetBrowserStartupIsComplete() {
g_after_startup_tasks.Get().size());
g_startup_complete_flag.Get().Set();
for (AfterStartupTask* queued_task : g_after_startup_tasks.Get())
ScheduleTask(make_scoped_ptr(queued_task));
ScheduleTask(base::WrapUnique(queued_task));
g_after_startup_tasks.Get().clear();
// The shrink_to_fit() method is not available for all of our build targets.
......@@ -206,7 +207,7 @@ void AfterStartupTaskUtils::PostTask(
return;
}
scoped_ptr<AfterStartupTask> queued_task(
std::unique_ptr<AfterStartupTask> queued_task(
new AfterStartupTask(from_here, task_runner, task));
QueueTask(std::move(queued_task));
}
......
......@@ -4,10 +4,11 @@
#include "chrome/browser/after_startup_task_utils.h"
#include <memory>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/task_runner_util.h"
......
......@@ -8,11 +8,12 @@
#if defined(__OBJC__)
#import <Cocoa/Cocoa.h>
#include <memory>
#include <vector>
#include "base/files/file_path.h"
#include "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/time/time.h"
#include "components/prefs/pref_change_registrar.h"
......@@ -43,7 +44,7 @@ class WorkAreaWatcherObserver;
NSApplicationDelegate> {
@private
// Manages the state of the command menu items.
scoped_ptr<CommandUpdater> menuState_;
std::unique_ptr<CommandUpdater> menuState_;
// The profile last used by a Browser. It is this profile that was used to
// build the user-data specific main menu items.
......@@ -51,7 +52,8 @@ class WorkAreaWatcherObserver;
// The ProfileObserver observes the ProfileAttrbutesStorage and gets notified
// when a profile has been deleted.
scoped_ptr<AppControllerProfileObserver> profileAttributesStorageObserver_;
std::unique_ptr<AppControllerProfileObserver>
profileAttributesStorageObserver_;
// Management of the bookmark menu which spans across all windows
// (and Browser*s). |profileBookmarkMenuBridgeMap_| is a cache that owns one
......@@ -61,7 +63,7 @@ class WorkAreaWatcherObserver;
BookmarkMenuBridge* bookmarkMenuBridge_;
std::map<base::FilePath, BookmarkMenuBridge*> profileBookmarkMenuBridgeMap_;
scoped_ptr<HistoryMenuBridge> historyMenuBridge_;
std::unique_ptr<HistoryMenuBridge> historyMenuBridge_;
// Controller that manages main menu items for packaged apps.
base::scoped_nsobject<AppShimMenuController> appShimMenuController_;
......@@ -93,7 +95,7 @@ class WorkAreaWatcherObserver;
// Observers that listen to the work area changes.
base::ObserverList<ui::WorkAreaWatcherObserver> workAreaChangeObservers_;
scoped_ptr<PrefChangeRegistrar> profilePrefRegistrar_;
std::unique_ptr<PrefChangeRegistrar> profilePrefRegistrar_;
PrefChangeRegistrar localPrefRegistrar_;
// Displays a notification when quitting while apps are running.
......@@ -103,14 +105,14 @@ class WorkAreaWatcherObserver;
base::scoped_nsobject<HandoffManager> handoffManager_;
// Observes changes to the active URL.
scoped_ptr<HandoffActiveURLObserverBridge>
std::unique_ptr<HandoffActiveURLObserverBridge>
handoff_active_url_observer_bridge_;
// This will be true after receiving a NSWorkspaceWillPowerOffNotification.
BOOL isPoweringOff_;
// Request to keep the browser alive during that object's lifetime.
scoped_ptr<ScopedKeepAlive> keep_alive_;
std::unique_ptr<ScopedKeepAlive> keep_alive_;
}
@property(readonly, nonatomic) BOOL startupComplete;
......
......@@ -58,7 +58,7 @@ gfx::Size GetSmallAppIconSize() {
GetSystemMetrics(SM_CYSMICON));
}
scoped_ptr<gfx::ImageFamily> GetAppIconImageFamily() {
std::unique_ptr<gfx::ImageFamily> GetAppIconImageFamily() {
const int icon_id = GetAppIconResourceId();
// Get the icon from chrome.dll (not chrome.exe, which has different resource
// IDs). If chrome.dll is not loaded, we are probably in a unit test, so fall
......
......@@ -7,7 +7,7 @@
#include <windows.h>
#include "base/memory/scoped_ptr.h"
#include <memory>
namespace gfx {
class ImageFamily;
......@@ -24,6 +24,6 @@ gfx::Size GetSmallAppIconSize();
// Retrieve the application icon for the current process. This returns all of
// the different sizes of the icon as an ImageFamily.
scoped_ptr<gfx::ImageFamily> GetAppIconImageFamily();
std::unique_ptr<gfx::ImageFamily> GetAppIconImageFamily();
#endif // CHROME_BROWSER_APP_ICON_WIN_H_
......@@ -4,6 +4,7 @@
#include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/autocomplete/in_memory_url_index_factory.h"
......@@ -33,14 +34,14 @@ AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() {
}
// static
scoped_ptr<KeyedService> AutocompleteClassifierFactory::BuildInstanceFor(
std::unique_ptr<KeyedService> AutocompleteClassifierFactory::BuildInstanceFor(
content::BrowserContext* context) {
Profile* profile = static_cast<Profile*>(context);
return make_scoped_ptr(new AutocompleteClassifier(
make_scoped_ptr(new AutocompleteController(
make_scoped_ptr(new ChromeAutocompleteProviderClient(profile)), NULL,
return base::WrapUnique(new AutocompleteClassifier(
base::WrapUnique(new AutocompleteController(
base::WrapUnique(new ChromeAutocompleteProviderClient(profile)), NULL,
AutocompleteClassifier::kDefaultOmniboxProviders)),
scoped_ptr<AutocompleteSchemeClassifier>(
std::unique_ptr<AutocompleteSchemeClassifier>(
new ChromeAutocompleteSchemeClassifier(profile))));
}
......
......@@ -5,8 +5,9 @@
#ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_FACTORY_H_
#define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_FACTORY_H_
#include <memory>
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
......@@ -22,7 +23,7 @@ class AutocompleteClassifierFactory : public BrowserContextKeyedServiceFactory {
static AutocompleteClassifierFactory* GetInstance();
static scoped_ptr<KeyedService> BuildInstanceFor(
static std::unique_ptr<KeyedService> BuildInstanceFor(
content::BrowserContext* context);
private:
......
......@@ -7,6 +7,7 @@
#include <stddef.h>
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
......@@ -137,11 +138,11 @@ ChromeAutocompleteProviderClient::GetShortcutsBackendIfExists() {
return ShortcutsBackendFactory::GetForProfileIfExists(profile_);
}
scoped_ptr<KeywordExtensionsDelegate>
std::unique_ptr<KeywordExtensionsDelegate>
ChromeAutocompleteProviderClient::GetKeywordExtensionsDelegate(
KeywordProvider* keyword_provider) {
#if defined(ENABLE_EXTENSIONS)
return make_scoped_ptr(
return base::WrapUnique(
new KeywordExtensionsDelegateImpl(profile_, keyword_provider));
#else
return nullptr;
......
......@@ -32,7 +32,7 @@ class ChromeAutocompleteProviderClient : public AutocompleteProviderClient {
const SearchTermsData& GetSearchTermsData() const override;
scoped_refptr<ShortcutsBackend> GetShortcutsBackend() override;
scoped_refptr<ShortcutsBackend> GetShortcutsBackendIfExists() override;
scoped_ptr<KeywordExtensionsDelegate> GetKeywordExtensionsDelegate(
std::unique_ptr<KeywordExtensionsDelegate> GetKeywordExtensionsDelegate(
KeywordProvider* keyword_provider) override;
std::string GetAcceptLanguages() const override;
std::string GetEmbedderRepresentationOfAboutScheme() override;
......
......@@ -83,7 +83,8 @@ void KeywordExtensionsDelegateImplTest::SetUp() {
}
void KeywordExtensionsDelegateImplTest::RunTest(bool incognito) {
scoped_ptr<TemplateURLService> empty_model(new TemplateURLService(NULL, 0));
std::unique_ptr<TemplateURLService> empty_model(
new TemplateURLService(NULL, 0));
MockAutocompleteProviderClient client;
client.set_template_url_service(std::move(empty_model));
scoped_refptr<KeywordProvider> keyword_provider =
......
......@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
#include "base/strings/string16.h"
......@@ -167,7 +168,7 @@ class SearchProviderTest : public testing::Test,
protected:
// Needed for AutocompleteFieldTrial::ActivateStaticTrials();
scoped_ptr<base::FieldTrialList> field_trial_list_;
std::unique_ptr<base::FieldTrialList> field_trial_list_;
// Default values used for testing.
static const std::string kNotApplicable;
......@@ -257,7 +258,7 @@ class SearchProviderTest : public testing::Test,
net::TestURLFetcherFactory test_factory_;
TestingProfile profile_;
scoped_ptr<ChromeAutocompleteProviderClient> client_;
std::unique_ptr<ChromeAutocompleteProviderClient> client_;
scoped_refptr<SearchProviderForTest> provider_;
// If non-NULL, OnProviderUpdate quits the current |run_loop_|.
......@@ -1090,8 +1091,8 @@ TEST_F(SearchProviderTest, KeywordOrderingAndDescriptions) {
profile_.BlockUntilHistoryProcessesPendingRequests();
AutocompleteController controller(
make_scoped_ptr(new ChromeAutocompleteProviderClient(&profile_)), nullptr,
AutocompleteProvider::TYPE_SEARCH);
base::WrapUnique(new ChromeAutocompleteProviderClient(&profile_)),
nullptr, AutocompleteProvider::TYPE_SEARCH);
controller.Start(AutocompleteInput(
ASCIIToUTF16("k t"), base::string16::npos, std::string(), GURL(),
metrics::OmniboxEventProto::INVALID_SPEC, false, false, true, true, false,
......
......@@ -4,7 +4,9 @@
#include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
#include "base/memory/scoped_ptr.h"
#include <memory>
#include "base/memory/ptr_util.h"
#include "chrome/browser/autocomplete/shortcuts_extensions_manager.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
......@@ -90,7 +92,7 @@ scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::CreateShortcutsBackend(
bool suppress_db) {
scoped_refptr<ShortcutsBackend> backend(new ShortcutsBackend(
TemplateURLServiceFactory::GetForProfile(profile),
make_scoped_ptr(new UIThreadSearchTermsData(profile)),
base::WrapUnique(new UIThreadSearchTermsData(profile)),
HistoryServiceFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
content::BrowserThread::GetMessageLoopProxyForThread(
......
......@@ -74,7 +74,7 @@ class BackgroundApplicationListModel::Application
void RequestIcon(extension_misc::ExtensionIcons size);
const Extension* extension_;
scoped_ptr<gfx::ImageSkia> icon_;
std::unique_ptr<gfx::ImageSkia> icon_;
BackgroundApplicationListModel* model_;
};
......
......@@ -4,16 +4,16 @@
// TODO(rickcam): Bug 73183: Add unit tests for image loading
#include "chrome/browser/background/background_application_list_model.h"
#include <stddef.h>
#include <cstdlib>
#include <memory>
#include <set>
#include "chrome/browser/background/background_application_list_model.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
#include "build/build_config.h"
......@@ -150,7 +150,7 @@ TEST_F(BackgroundApplicationListModelTest, MAYBE_ExplicitTest) {
InitializeAndLoadEmptyExtensionService();
ASSERT_TRUE(service()->is_ready());
ASSERT_TRUE(registry()->enabled_extensions().is_empty());
scoped_ptr<BackgroundApplicationListModel> model(
std::unique_ptr<BackgroundApplicationListModel> model(
new BackgroundApplicationListModel(profile_.get()));
ASSERT_EQ(0U, model->size());
......@@ -222,7 +222,7 @@ TEST_F(BackgroundApplicationListModelTest, AddRemovePermissionsTest) {
InitializeAndLoadEmptyExtensionService();
ASSERT_TRUE(service()->is_ready());
ASSERT_TRUE(registry()->enabled_extensions().is_empty());
scoped_ptr<BackgroundApplicationListModel> model(
std::unique_ptr<BackgroundApplicationListModel> model(
new BackgroundApplicationListModel(profile_.get()));
ASSERT_EQ(0U, model->size());
......@@ -378,7 +378,7 @@ TEST_F(BackgroundApplicationListModelTest, RandomTest) {
InitializeAndLoadEmptyExtensionService();
ASSERT_TRUE(service()->is_ready());
ASSERT_TRUE(registry()->enabled_extensions().is_empty());
scoped_ptr<BackgroundApplicationListModel> model(
std::unique_ptr<BackgroundApplicationListModel> model(
new BackgroundApplicationListModel(profile_.get()));
ASSERT_EQ(0U, model->size());
......
......@@ -7,10 +7,10 @@
#include <stdint.h>
#include <memory>
#include <string>
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
......@@ -109,10 +109,10 @@ class BackgroundContents : public extensions::DeferredStartRenderHost,
Delegate* delegate_;
// Delegate for choosing an ExtensionHostQueue.
scoped_ptr<extensions::ExtensionHostDelegate> extension_host_delegate_;
std::unique_ptr<extensions::ExtensionHostDelegate> extension_host_delegate_;
Profile* profile_;
scoped_ptr<content::WebContents> web_contents_;
std::unique_ptr<content::WebContents> web_contents_;
content::NotificationRegistrar registrar_;
base::ObserverList<extensions::DeferredStartRenderHostObserver>
deferred_start_render_host_observer_list_;
......
......@@ -2,16 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/background/background_contents_service.h"
#include <memory>
#include <string>
#include "base/command_line.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/background/background_contents.h"
#include "chrome/browser/background/background_contents_service.h"
#include "chrome/browser/background/background_contents_service_factory.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/ui/browser_list.h"
......@@ -69,7 +70,7 @@ class BackgroundContentsServiceTest : public testing::Test {
}
content::TestBrowserThreadBundle thread_bundle_;
scoped_ptr<base::CommandLine> command_line_;
std::unique_ptr<base::CommandLine> command_line_;
};
class MockBackgroundContents : public BackgroundContents {
......@@ -221,7 +222,7 @@ class BackgroundContentsServiceNotificationTest
}
private:
scoped_ptr<TestingProfileManager> profile_manager_;
std::unique_ptr<TestingProfileManager> profile_manager_;
DISALLOW_COPY_AND_ASSIGN(BackgroundContentsServiceNotificationTest);
};
......@@ -253,7 +254,7 @@ TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAdded) {
GURL url("http://a/");
GURL url2("http://a/");
{
scoped_ptr<MockBackgroundContents> contents(
std::unique_ptr<MockBackgroundContents> contents(
new MockBackgroundContents(&profile));
EXPECT_EQ(0U, GetPrefs(&profile)->size());
contents->SendOpenedNotification(&service);
......@@ -300,8 +301,8 @@ TEST_F(BackgroundContentsServiceTest, RestartBackgroundContents) {
GURL url("http://a/");
{
scoped_ptr<MockBackgroundContents> contents(new MockBackgroundContents(
&profile, "appid"));
std::unique_ptr<MockBackgroundContents> contents(
new MockBackgroundContents(&profile, "appid"));
contents->SendOpenedNotification(&service);
contents->Navigate(url);
EXPECT_EQ(1U, GetPrefs(&profile)->size());
......@@ -313,8 +314,8 @@ TEST_F(BackgroundContentsServiceTest, RestartBackgroundContents) {
{
// Reopen the BackgroundContents to the same URL, we should not register the
// URL again.
scoped_ptr<MockBackgroundContents> contents(new MockBackgroundContents(
&profile, "appid"));
std::unique_ptr<MockBackgroundContents> contents(
new MockBackgroundContents(&profile, "appid"));
contents->SendOpenedNotification(&service);
contents->Navigate(url);
EXPECT_EQ(1U, GetPrefs(&profile)->size());
......@@ -334,7 +335,7 @@ TEST_F(BackgroundContentsServiceTest, TestApplicationIDLinkage) {
service.GetAppBackgroundContents(base::ASCIIToUTF16("appid")));
MockBackgroundContents* contents = new MockBackgroundContents(&profile,
"appid");
scoped_ptr<MockBackgroundContents> contents2(
std::unique_ptr<MockBackgroundContents> contents2(
new MockBackgroundContents(&profile, "appid2"));
contents->SendOpenedNotification(&service);
EXPECT_EQ(contents, service.GetAppBackgroundContents(contents->appid()));
......
......@@ -884,7 +884,7 @@ gfx::ImageSkia GetStatusTrayIcon() {
// the ImageFamily abstraction. Note: We could just use the LoadImage function
// from the Windows API, but that does a *terrible* job scaling images.
// Therefore, we fetch the images and do our own high-quality scaling.
scoped_ptr<gfx::ImageFamily> family = GetAppIconImageFamily();
std::unique_ptr<gfx::ImageFamily> family = GetAppIconImageFamily();
DCHECK(family);
if (!family)
return gfx::ImageSkia();
......@@ -940,7 +940,7 @@ void BackgroundModeManager::UpdateStatusTrayIconContextMenu() {
command_id_handler_vector_.clear();
submenus.clear();
scoped_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(this));
std::unique_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(this));
menu->AddItem(IDC_ABOUT, l10n_util::GetStringUTF16(IDS_ABOUT));
menu->AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
menu->AddSeparator(ui::NORMAL_SEPARATOR);
......
......@@ -152,7 +152,7 @@ class BackgroundModeManager
~BackgroundModeData() override;
// The cached list of BackgroundApplications.
scoped_ptr<BackgroundApplicationListModel> applications_;
std::unique_ptr<BackgroundApplicationListModel> applications_;
// Overrides from StatusIconMenuModel::Delegate implementation.
void ExecuteCommand(int command_id, int event_flags) override;
......@@ -420,12 +420,12 @@ class BackgroundModeManager
// Background mode does not always keep Chrome alive. When it does, it is
// using this scoped object.
scoped_ptr<ScopedKeepAlive> keep_alive_;
std::unique_ptr<ScopedKeepAlive> keep_alive_;
// Set when we are keeping chrome running during the startup process - this
// is required when running with the --no-startup-window flag, as otherwise
// chrome would immediately exit due to having no open windows.
scoped_ptr<ScopedKeepAlive> keep_alive_for_startup_;
std::unique_ptr<ScopedKeepAlive> keep_alive_for_startup_;
// Set to true when Chrome is running with the --keep-alive-for-test flag
// (used for testing background mode without having to install a background
......
......@@ -2,20 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/background/background_mode_manager.h"
#include <stddef.h>
#include <memory>
#include <string>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_simple_task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/background/background_trigger.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
......@@ -58,8 +59,8 @@ using testing::StrictMock;
namespace {
scoped_ptr<TestingProfileManager> CreateTestingProfileManager() {
scoped_ptr<TestingProfileManager> profile_manager(
std::unique_ptr<TestingProfileManager> CreateTestingProfileManager() {
std::unique_ptr<TestingProfileManager> profile_manager(
new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
EXPECT_TRUE(profile_manager->SetUp());
return profile_manager;
......@@ -207,9 +208,9 @@ class BackgroundModeManagerTest : public testing::Test {
protected:
content::TestBrowserThreadBundle thread_bundle_;
scoped_ptr<base::CommandLine> command_line_;
std::unique_ptr<base::CommandLine> command_line_;
scoped_ptr<TestingProfileManager> profile_manager_;
std::unique_ptr<TestingProfileManager> profile_manager_;
// Test profile used by all tests - this is owned by profile_manager_.
TestingProfile* profile_;
......@@ -286,7 +287,7 @@ class BackgroundModeManagerWithExtensionsTest : public testing::Test {
extensions::Manifest::Location location,
const std::string& data,
const std::string& id) {
scoped_ptr<base::DictionaryValue> parsed_manifest(
std::unique_ptr<base::DictionaryValue> parsed_manifest(
extensions::api_test_utils::ParseDictionary(data));
return extensions::api_test_utils::CreateExtension(
location, parsed_manifest.get(), id);
......@@ -301,11 +302,11 @@ class BackgroundModeManagerWithExtensionsTest : public testing::Test {
return false;
}
scoped_ptr<TestBackgroundModeManager> manager_;
std::unique_ptr<TestBackgroundModeManager> manager_;
scoped_ptr<base::CommandLine> command_line_;
std::unique_ptr<base::CommandLine> command_line_;
scoped_ptr<TestingProfileManager> profile_manager_;
std::unique_ptr<TestingProfileManager> profile_manager_;
// Test profile used by all tests - this is owned by profile_manager_.
TestingProfile* profile_;
......@@ -317,7 +318,7 @@ class BackgroundModeManagerWithExtensionsTest : public testing::Test {
// tearing down our thread bundle before we've had chance to clean
// everything up. Keeping Chrome alive prevents this.
// We aren't interested in if the keep alive works correctly in this test.
scoped_ptr<ScopedKeepAlive> test_keep_alive_;
std::unique_ptr<ScopedKeepAlive> test_keep_alive_;
#if defined(OS_CHROMEOS)
// ChromeOS needs extra services to run in the following order.
......@@ -708,8 +709,8 @@ TEST_F(BackgroundModeManagerWithExtensionsTest, BackgroundMenuGeneration) {
service->AddExtension(regular_extension_with_options.get());
Mock::VerifyAndClearExpectations(manager_.get());
scoped_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(NULL));
scoped_ptr<StatusIconMenuModel> submenu(new StatusIconMenuModel(NULL));
std::unique_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(NULL));
std::unique_ptr<StatusIconMenuModel> submenu(new StatusIconMenuModel(NULL));
BackgroundModeManager::BackgroundModeData* bmd =
manager_->GetBackgroundModeData(profile_);
bmd->BuildProfileMenu(submenu.get(), menu.get());
......
......@@ -66,8 +66,8 @@ class BackgroundSyncControllerImplTest : public testing::Test {