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

Unified Diff: chrome/browser/ui/views/app_list/app_list_controller_win.cc

Issue 12208040: [win] Add a progress bar in the app launcher for app installs. (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/ui/views/app_list/app_list_controller_win.cc
diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
index ecf13d706027b83058eee9e0a574392112a44ec0..4c490cfa4b43be97cd5c854c8e39cb0469345f7b 100644
--- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc
+++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
@@ -191,6 +191,9 @@ class AppListController : public ProfileInfoCacheObserver {
const std::string& extension_id,
const std::string& extension_name,
const gfx::ImageSkia& installing_icon);
+ void OnDownloadProgress(Profile* profile,
+ const std::string& extension_id,
+ int percent_downloaded);
private:
// Loads a profile asynchronously and calls OnProfileLoaded() when done.
@@ -546,6 +549,18 @@ void AppListController::OnBeginExtensionInstall(
installing_icon);
}
+void AppListController::OnDownloadProgress(Profile* profile,
+ const std::string& extension_id,
+ int percent_downloaded) {
+ // We only have a model for the current profile, so ignore events about
+ // others.
+ // TODO(koz): We should keep a model for each profile so we can record
+ // information like this.
+ if (profile != profile_)
+ return;
+ view_delegate_->OnDownloadProgress(extension_id, percent_downloaded);
+}
+
// Attempts to find the bounds of the Windows taskbar. Returns true on success.
// |rect| is in screen coordinates. If the taskbar is in autohide mode and is
// not visible, |rect| will be outside the current monitor's bounds, except for
@@ -859,4 +874,12 @@ void NotifyAppListOfBeginExtensionInstall(
installing_icon);
}
+void NotifyAppListOfDownloadProgress(
+ Profile* profile,
+ const std::string& extension_id,
+ int percent_downloaded) {
+ g_app_list_controller.Get().OnDownloadProgress(profile, extension_id,
+ percent_downloaded);
+}
+
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698