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

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

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.h
diff --git a/chrome/browser/extensions/install_tracker.h b/chrome/browser/extensions/install_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..2eaa4abd21d1f75b5730b8f0afdff9d8969aedb0
--- /dev/null
+++ b/chrome/browser/extensions/install_tracker.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
tfarina 2013/02/25 19:43:18 no (c)
koz (OOO until 15th September) 2013/02/25 23:35:19 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_
+#define CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_
+
+#include "base/observer_list.h"
+#include "chrome/browser/profiles/profile_keyed_service.h"
+#include "ui/gfx/image/image_skia.h"
tfarina 2013/02/25 19:43:18 forward declare this.
koz (OOO until 15th September) 2013/02/25 23:35:19 Done.
+
+namespace extensions {
+
+class InstallObserver {
tfarina 2013/02/25 19:43:18 please, put this into c/b/e/install_observer.h
koz (OOO until 15th September) 2013/02/25 23:35:19 Done.
+ public:
+ virtual void OnBeginExtensionInstall(
+ const std::string& extension_id,
+ const std::string& extension_name,
+ const gfx::ImageSkia& installing_icon,
+ bool is_app) = 0;
+
+ virtual void OnDownloadProgress(const std::string& extension_id,
+ int percent_downloaded) = 0;
+
+ virtual void OnInstallFailure(const std::string& extension_id) = 0;
+
+ protected:
+ virtual ~InstallObserver() {}
+};
+
+class InstallTracker : public ProfileKeyedService {
+ public:
+ explicit InstallTracker();
tfarina 2013/02/25 19:43:18 no explicit
koz (OOO until 15th September) 2013/02/25 23:35:19 Done.
+ virtual ~InstallTracker();
+
+ // ProfileKeyedService implementation.
tfarina 2013/02/25 19:43:18 I don't think this is an implementation of Profile
koz (OOO until 15th September) 2013/02/25 23:35:19 Done.
+ void AddObserver(InstallObserver* observer);
+ void RemoveObserver(InstallObserver* observer);
+
+ void OnBeginExtensionInstall(
tfarina 2013/02/25 19:43:18 why these three methods have the same names of Ins
koz (OOO until 15th September) 2013/02/25 23:35:19 This class acts as a broadcaster - it gets notifie
+ const std::string& extension_id,
+ const std::string& extension_name,
+ const gfx::ImageSkia& installing_icon,
+ bool is_app);
+ void OnDownloadProgress(const std::string& extension_id,
+ int percent_downloaded);
tfarina 2013/02/25 19:43:18 wrong indent
koz (OOO until 15th September) 2013/02/25 23:35:19 Done.
+ void OnInstallFailure(const std::string& extension_id);
+
+ private:
+ ObserverList<InstallObserver> observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(InstallTracker);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_
« no previous file with comments | « chrome/browser/extensions/api/webstore_private/webstore_private_api.cc ('k') | chrome/browser/extensions/install_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698