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

Unified Diff: chrome/browser/extensions/install_tracker.cc

Issue 12298015: Change NotifyAppList*() functions into observers on a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/install_tracker.cc
diff --git a/chrome/browser/extensions/install_tracker.cc b/chrome/browser/extensions/install_tracker.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0734346eb06ff8eb01ac82c06dd7de52d3ccc861
--- /dev/null
+++ b/chrome/browser/extensions/install_tracker.cc
@@ -0,0 +1,47 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/install_tracker.h"
+
+namespace extensions {
+
+InstallTracker::InstallTracker() {
+}
+
+InstallTracker::~InstallTracker() {
+}
+
+void InstallTracker::OnBeginExtensionInstall(
+ const std::string& extension_id,
+ const std::string& extension_name,
+ const gfx::ImageSkia& installing_icon,
+ bool is_app) {
+ FOR_EACH_OBSERVER(InstallObserver, observers_,
+ OnBeginExtensionInstall(extension_id,
tfarina 2013/02/25 23:43:02 If it fits I'd align with InstallObserver. Up to y
koz (OOO until 15th September) 2013/02/26 00:10:51 Done.
+ extension_name,
+ installing_icon,
+ is_app));
+}
+
+void InstallTracker::OnDownloadProgress(const std::string& extension_id,
+ int percent_downloaded) {
+ FOR_EACH_OBSERVER(InstallObserver, observers_,
+ OnDownloadProgress(extension_id, percent_downloaded));
+}
+
+void InstallTracker::OnInstallFailure(
+ const std::string& extension_id) {
+ FOR_EACH_OBSERVER(InstallObserver, observers_,
+ OnInstallFailure(extension_id));
tfarina 2013/02/25 23:43:02 If it fits I'd align with InstallObserver. Up to y
koz (OOO until 15th September) 2013/02/26 00:10:51 Done.
+}
+
+void InstallTracker::AddObserver(InstallObserver* observer) {
tfarina 2013/02/25 23:43:02 the order doesn't match with the order declared in
koz (OOO until 15th September) 2013/02/26 00:10:51 Done.
+ observers_.AddObserver(observer);
+}
+
+void InstallTracker::RemoveObserver(InstallObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698