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

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

Issue 140343002: extensions: Relocate pref name constants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing include for mac Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/install_tracker.h" 5 #include "chrome/browser/extensions/install_tracker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/extensions/extension_prefs.h" 9 #include "chrome/browser/extensions/extension_prefs.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
11 #include "content/public/browser/notification_service.h" 11 #include "content/public/browser/notification_service.h"
12 #include "extensions/browser/pref_names.h"
12 13
13 namespace extensions { 14 namespace extensions {
14 15
15 InstallTracker::InstallTracker(Profile* profile, 16 InstallTracker::InstallTracker(Profile* profile,
16 extensions::ExtensionPrefs* prefs) { 17 extensions::ExtensionPrefs* prefs) {
17 AppSorting* sorting = prefs->app_sorting(); 18 AppSorting* sorting = prefs->app_sorting();
18 19
19 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, 20 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED,
20 content::Source<Profile>(profile)); 21 content::Source<Profile>(profile));
21 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 22 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
22 content::Source<Profile>(profile)); 23 content::Source<Profile>(profile));
23 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 24 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
24 content::Source<Profile>(profile)); 25 content::Source<Profile>(profile));
25 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, 26 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
26 content::Source<Profile>(profile)); 27 content::Source<Profile>(profile));
27 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED, 28 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
28 content::Source<AppSorting>(sorting)); 29 content::Source<AppSorting>(sorting));
29 registrar_.Add(this, chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, 30 registrar_.Add(this, chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST,
30 content::Source<Profile>(profile)); 31 content::Source<Profile>(profile));
31 32
32 pref_change_registrar_.Init(prefs->pref_service()); 33 pref_change_registrar_.Init(prefs->pref_service());
33 pref_change_registrar_.Add(prefs::kExtensionsPref, 34 pref_change_registrar_.Add(pref_names::kExtensions,
34 base::Bind(&InstallTracker::OnAppsReordered, 35 base::Bind(&InstallTracker::OnAppsReordered,
35 base::Unretained(this))); 36 base::Unretained(this)));
36 } 37 }
37 38
38 InstallTracker::~InstallTracker() { 39 InstallTracker::~InstallTracker() {
39 } 40 }
40 41
41 void InstallTracker::AddObserver(InstallObserver* observer) { 42 void InstallTracker::AddObserver(InstallObserver* observer) {
42 observers_.AddObserver(observer); 43 observers_.AddObserver(observer);
43 } 44 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 default: 118 default:
118 NOTREACHED(); 119 NOTREACHED();
119 } 120 }
120 } 121 }
121 122
122 void InstallTracker::OnAppsReordered() { 123 void InstallTracker::OnAppsReordered() {
123 FOR_EACH_OBSERVER(InstallObserver, observers_, OnAppsReordered()); 124 FOR_EACH_OBSERVER(InstallObserver, observers_, OnAppsReordered());
124 } 125 }
125 126
126 } // namespace extensions 127 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698