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

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

Issue 2422963002: Remove FOR_EACH_OBSERVER macro usage in chrome/browser/extensions (Closed)
Patch Set: extensions Created 4 years, 2 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.h" 5 #include "chrome/browser/extensions/extension_management.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 431 }
432 return nullptr; 432 return nullptr;
433 } 433 }
434 434
435 void ExtensionManagement::OnExtensionPrefChanged() { 435 void ExtensionManagement::OnExtensionPrefChanged() {
436 Refresh(); 436 Refresh();
437 NotifyExtensionManagementPrefChanged(); 437 NotifyExtensionManagementPrefChanged();
438 } 438 }
439 439
440 void ExtensionManagement::NotifyExtensionManagementPrefChanged() { 440 void ExtensionManagement::NotifyExtensionManagementPrefChanged() {
441 FOR_EACH_OBSERVER( 441 for (auto& observer : observer_list_)
442 Observer, observer_list_, OnExtensionManagementSettingsChanged()); 442 observer.OnExtensionManagementSettingsChanged();
443 } 443 }
444 444
445 internal::IndividualSettings* ExtensionManagement::AccessById( 445 internal::IndividualSettings* ExtensionManagement::AccessById(
446 const ExtensionId& id) { 446 const ExtensionId& id) {
447 DCHECK(crx_file::id_util::IdIsValid(id)) << "Invalid ID: " << id; 447 DCHECK(crx_file::id_util::IdIsValid(id)) << "Invalid ID: " << id;
448 SettingsIdMap::iterator it = settings_by_id_.find(id); 448 SettingsIdMap::iterator it = settings_by_id_.find(id);
449 if (it == settings_by_id_.end()) { 449 if (it == settings_by_id_.end()) {
450 std::unique_ptr<internal::IndividualSettings> settings( 450 std::unique_ptr<internal::IndividualSettings> settings(
451 new internal::IndividualSettings(default_settings_.get())); 451 new internal::IndividualSettings(default_settings_.get()));
452 it = settings_by_id_.add(id, std::move(settings)).first; 452 it = settings_by_id_.add(id, std::move(settings)).first;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 content::BrowserContext* context) const { 497 content::BrowserContext* context) const {
498 return chrome::GetBrowserContextRedirectedInIncognito(context); 498 return chrome::GetBrowserContextRedirectedInIncognito(context);
499 } 499 }
500 500
501 void ExtensionManagementFactory::RegisterProfilePrefs( 501 void ExtensionManagementFactory::RegisterProfilePrefs(
502 user_prefs::PrefRegistrySyncable* user_prefs) { 502 user_prefs::PrefRegistrySyncable* user_prefs) {
503 user_prefs->RegisterDictionaryPref(pref_names::kExtensionManagement); 503 user_prefs->RegisterDictionaryPref(pref_names::kExtensionManagement);
504 } 504 }
505 505
506 } // namespace extensions 506 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_error_reporter.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698