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

Side by Side Diff: chrome/browser/extensions/extension_management_test_util.cc

Issue 2152373003: [Extensions] Code Cleanup - Remove redundant smart-ptr get()s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extension_management_test_util.h" 5 #include "chrome/browser/extensions/extension_management_test_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "components/crx_file/id_util.h" 10 #include "components/crx_file/id_util.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // Helper functions for 'installation_mode' manipulation ----------------------- 54 // Helper functions for 'installation_mode' manipulation -----------------------
55 55
56 void ExtensionManagementPrefUpdaterBase::SetBlacklistedByDefault(bool value) { 56 void ExtensionManagementPrefUpdaterBase::SetBlacklistedByDefault(bool value) {
57 pref_->SetString(make_path(schema::kWildcard, schema::kInstallationMode), 57 pref_->SetString(make_path(schema::kWildcard, schema::kInstallationMode),
58 value ? schema::kBlocked : schema::kAllowed); 58 value ? schema::kBlocked : schema::kAllowed);
59 } 59 }
60 60
61 void ExtensionManagementPrefUpdaterBase:: 61 void ExtensionManagementPrefUpdaterBase::
62 ClearInstallationModesForIndividualExtensions() { 62 ClearInstallationModesForIndividualExtensions() {
63 for (base::DictionaryValue::Iterator it(*pref_.get()); !it.IsAtEnd(); 63 for (base::DictionaryValue::Iterator it(*pref_); !it.IsAtEnd();
64 it.Advance()) { 64 it.Advance()) {
65 DCHECK(it.value().IsType(base::Value::TYPE_DICTIONARY)); 65 DCHECK(it.value().IsType(base::Value::TYPE_DICTIONARY));
66 if (it.key() != schema::kWildcard) { 66 if (it.key() != schema::kWildcard) {
67 DCHECK(crx_file::id_util::IdIsValid(it.key())); 67 DCHECK(crx_file::id_util::IdIsValid(it.key()));
68 pref_->Remove(make_path(it.key(), schema::kInstallationMode), nullptr); 68 pref_->Remove(make_path(it.key(), schema::kInstallationMode), nullptr);
69 pref_->Remove(make_path(it.key(), schema::kUpdateUrl), nullptr); 69 pref_->Remove(make_path(it.key(), schema::kUpdateUrl), nullptr);
70 } 70 }
71 } 71 }
72 } 72 }
73 73
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 policies_ 264 policies_
265 ->Get( 265 ->Get(
266 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string())) 266 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string()))
267 .Set(policy::key::kExtensionSettings, policy::POLICY_LEVEL_MANDATORY, 267 .Set(policy::key::kExtensionSettings, policy::POLICY_LEVEL_MANDATORY,
268 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, TakePref(), 268 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, TakePref(),
269 nullptr); 269 nullptr);
270 provider_->UpdatePolicy(std::move(policies_)); 270 provider_->UpdatePolicy(std::move(policies_));
271 } 271 }
272 272
273 } // namespace extensions 273 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698