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

Side by Side Diff: chrome/browser/extensions/api/font_settings/font_settings_api.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Font Settings Extension API implementation. 5 // Font Settings Extension API implementation.
6 6
7 #include "chrome/browser/extensions/api/font_settings/font_settings_api.h" 7 #include "chrome/browser/extensions/api/font_settings/font_settings_api.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 NOTREACHED(); 333 NOTREACHED();
334 return false; 334 return false;
335 } 335 }
336 336
337 std::string localized_name; 337 std::string localized_name;
338 if (!font_list_value->GetString(1, &localized_name)) { 338 if (!font_list_value->GetString(1, &localized_name)) {
339 NOTREACHED(); 339 NOTREACHED();
340 return false; 340 return false;
341 } 341 }
342 342
343 base::DictionaryValue* font_name = new base::DictionaryValue(); 343 std::unique_ptr<base::DictionaryValue> font_name(
344 new base::DictionaryValue());
344 font_name->Set(kFontIdKey, new base::StringValue(name)); 345 font_name->Set(kFontIdKey, new base::StringValue(name));
345 font_name->Set(kDisplayNameKey, new base::StringValue(localized_name)); 346 font_name->Set(kDisplayNameKey, new base::StringValue(localized_name));
346 result->Append(font_name); 347 result->Append(std::move(font_name));
347 } 348 }
348 349
349 SetResult(std::move(result)); 350 SetResult(std::move(result));
350 return true; 351 return true;
351 } 352 }
352 353
353 bool ClearFontPrefExtensionFunction::RunSync() { 354 bool ClearFontPrefExtensionFunction::RunSync() {
354 if (GetProfile()->IsOffTheRecord()) { 355 if (GetProfile()->IsOffTheRecord()) {
355 error_ = kSetFromIncognitoError; 356 error_ = kSetFromIncognitoError;
356 return false; 357 return false;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 456
456 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { 457 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() {
457 return prefs::kWebKitMinimumFontSize; 458 return prefs::kWebKitMinimumFontSize;
458 } 459 }
459 460
460 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { 461 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() {
461 return kPixelSizeKey; 462 return kPixelSizeKey;
462 } 463 }
463 464
464 } // namespace extensions 465 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698