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

Unified Diff: chrome/browser/extensions/extension_action_storage_manager.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header 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
Index: chrome/browser/extensions/extension_action_storage_manager.cc
diff --git a/chrome/browser/extensions/extension_action_storage_manager.cc b/chrome/browser/extensions/extension_action_storage_manager.cc
index acb0c38d20f14a2efced4128e4562763f723ba12..a00a595189641963441ed2daa1a372456fde18a1 100644
--- a/chrome/browser/extensions/extension_action_storage_manager.cc
+++ b/chrome/browser/extensions/extension_action_storage_manager.cc
@@ -5,11 +5,12 @@
#include "chrome/browser/extensions/extension_action_storage_manager.h"
#include <stdint.h>
+
+#include <memory>
#include <utility>
#include "base/base64.h"
#include "base/bind.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_action.h"
@@ -159,9 +160,10 @@ void SetDefaultsFromValue(const base::DictionaryValue* dict,
// Store |action|'s default values in a DictionaryValue for use in storing to
// disk.
-scoped_ptr<base::DictionaryValue> DefaultsToValue(ExtensionAction* action) {
+std::unique_ptr<base::DictionaryValue> DefaultsToValue(
+ ExtensionAction* action) {
const int kDefaultTabId = ExtensionAction::kDefaultTabId;
- scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString(kPopupUrlStorageKey,
action->GetPopupUrl(kDefaultTabId).spec());
@@ -178,7 +180,8 @@ scoped_ptr<base::DictionaryValue> DefaultsToValue(ExtensionAction* action) {
gfx::ImageSkia icon =
action->GetExplicitlySetIcon(kDefaultTabId).AsImageSkia();
if (!icon.isNull()) {
- scoped_ptr<base::DictionaryValue> icon_value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> icon_value(
+ new base::DictionaryValue());
std::vector<gfx::ImageSkiaRep> image_reps = icon.image_reps();
for (const gfx::ImageSkiaRep& rep : image_reps) {
int size = static_cast<int>(rep.scale() * icon.width());
@@ -244,7 +247,7 @@ void ExtensionActionStorageManager::WriteToStorage(
ExtensionAction* extension_action) {
StateStore* store = GetStateStore();
if (store) {
- scoped_ptr<base::DictionaryValue> defaults =
+ std::unique_ptr<base::DictionaryValue> defaults =
DefaultsToValue(extension_action);
store->SetExtensionValue(extension_action->extension_id(),
kBrowserActionStorageKey, std::move(defaults));
@@ -252,7 +255,8 @@ void ExtensionActionStorageManager::WriteToStorage(
}
void ExtensionActionStorageManager::ReadFromStorage(
- const std::string& extension_id, scoped_ptr<base::Value> value) {
+ const std::string& extension_id,
+ std::unique_ptr<base::Value> value) {
const Extension* extension = ExtensionRegistry::Get(browser_context_)->
enabled_extensions().GetByID(extension_id);
if (!extension)
« no previous file with comments | « chrome/browser/extensions/extension_action_storage_manager.h ('k') | chrome/browser/extensions/extension_action_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698