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

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

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month 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 | Annotate | Revision Log
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/component_loader.h" 5 #include "chrome/browser/extensions/component_loader.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 // the browser process has started. 400 // the browser process has started.
401 AddOrReloadEnterpriseWebStore(); 401 AddOrReloadEnterpriseWebStore();
402 402
403 #if defined(USE_ASH) 403 #if defined(USE_ASH)
404 AddChromeApp(); 404 AddChromeApp();
405 #endif 405 #endif
406 406
407 AddScriptBubble(); 407 AddScriptBubble();
408 } 408 }
409 409
410 void ComponentLoader::Observe( 410 void ComponentLoader::OnPreferenceChanged(PrefServiceBase* service,
411 int type, 411 const std::string& pref_name) {
412 const content::NotificationSource& source, 412 DCHECK_EQ(std::string(prefs::kEnterpriseWebStoreURL), pref_name);
413 const content::NotificationDetails& details) {
414 DCHECK_EQ(chrome::NOTIFICATION_PREF_CHANGED, type);
415 DCHECK_EQ(std::string(prefs::kEnterpriseWebStoreURL),
416 *content::Details<const std::string>(details).ptr());
417 AddOrReloadEnterpriseWebStore(); 413 AddOrReloadEnterpriseWebStore();
418 } 414 }
419 415
420 // static 416 // static
421 void ComponentLoader::RegisterUserPrefs(PrefService* prefs) { 417 void ComponentLoader::RegisterUserPrefs(PrefService* prefs) {
422 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, 418 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL,
423 std::string() /* default_value */, 419 std::string() /* default_value */,
424 PrefService::UNSYNCABLE_PREF); 420 PrefService::UNSYNCABLE_PREF);
425 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, 421 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName,
426 std::string() /* default_value */, 422 std::string() /* default_value */,
427 PrefService::UNSYNCABLE_PREF); 423 PrefService::UNSYNCABLE_PREF);
428 } 424 }
429 425
430 } // namespace extensions 426 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/component_loader.h ('k') | chrome/browser/extensions/extension_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698