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

Side by Side Diff: chrome/browser/extensions/api/preference/preference_api.cc

Issue 1991083002: Remove ExtensionFunction::SetResult(T*) overload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU Created 4 years, 7 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 #include "chrome/browser/extensions/api/preference/preference_api.h" 5 #include "chrome/browser/extensions/api/preference/preference_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 } 658 }
659 result->Set(keys::kValue, transformed_value); 659 result->Set(keys::kValue, transformed_value);
660 660
661 // Retrieve incognito status. 661 // Retrieve incognito status.
662 if (incognito) { 662 if (incognito) {
663 ExtensionPrefs* ep = ExtensionPrefs::Get(GetProfile()); 663 ExtensionPrefs* ep = ExtensionPrefs::Get(GetProfile());
664 result->SetBoolean(keys::kIncognitoSpecific, 664 result->SetBoolean(keys::kIncognitoSpecific,
665 ep->HasIncognitoPrefValue(browser_pref)); 665 ep->HasIncognitoPrefValue(browser_pref));
666 } 666 }
667 667
668 SetResult(result.release()); 668 SetResult(std::move(result));
669 return true; 669 return true;
670 } 670 }
671 671
672 SetPreferenceFunction::~SetPreferenceFunction() { } 672 SetPreferenceFunction::~SetPreferenceFunction() { }
673 673
674 bool SetPreferenceFunction::RunSync() { 674 bool SetPreferenceFunction::RunSync() {
675 std::string pref_key; 675 std::string pref_key;
676 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key)); 676 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key));
677 base::DictionaryValue* details = NULL; 677 base::DictionaryValue* details = NULL;
678 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details)); 678 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details));
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 pref_key, PreferenceFunction::PERMISSION_TYPE_WRITE, &browser_pref)) { 793 pref_key, PreferenceFunction::PERMISSION_TYPE_WRITE, &browser_pref)) {
794 return false; 794 return false;
795 } 795 }
796 796
797 PreferenceAPI::Get(GetProfile()) 797 PreferenceAPI::Get(GetProfile())
798 ->RemoveExtensionControlledPref(extension_id(), browser_pref, scope); 798 ->RemoveExtensionControlledPref(extension_id(), browser_pref, scope);
799 return true; 799 return true;
800 } 800 }
801 801
802 } // namespace extensions 802 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698