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

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

Issue 175263003: Add chrome.webstore API methods to allow sites to see progress of installation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 6 years, 9 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
« no previous file with comments | « chrome/browser/extensions/install_tracker.h ('k') | chrome/browser/extensions/tab_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
10 #include "content/public/browser/notification_service.h" 10 #include "content/public/browser/notification_service.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 void InstallTracker::RemoveObserver(InstallObserver* observer) { 49 void InstallTracker::RemoveObserver(InstallObserver* observer) {
50 observers_.RemoveObserver(observer); 50 observers_.RemoveObserver(observer);
51 } 51 }
52 52
53 void InstallTracker::OnBeginExtensionInstall( 53 void InstallTracker::OnBeginExtensionInstall(
54 const InstallObserver::ExtensionInstallParams& params) { 54 const InstallObserver::ExtensionInstallParams& params) {
55 FOR_EACH_OBSERVER(InstallObserver, observers_, 55 FOR_EACH_OBSERVER(InstallObserver, observers_,
56 OnBeginExtensionInstall(params)); 56 OnBeginExtensionInstall(params));
57 } 57 }
58 58
59 void InstallTracker::OnBeginExtensionDownload(const std::string& extension_id) {
60 FOR_EACH_OBSERVER(
61 InstallObserver, observers_, OnBeginExtensionDownload(extension_id));
62 }
63
59 void InstallTracker::OnDownloadProgress(const std::string& extension_id, 64 void InstallTracker::OnDownloadProgress(const std::string& extension_id,
60 int percent_downloaded) { 65 int percent_downloaded) {
61 FOR_EACH_OBSERVER(InstallObserver, observers_, 66 FOR_EACH_OBSERVER(InstallObserver, observers_,
62 OnDownloadProgress(extension_id, percent_downloaded)); 67 OnDownloadProgress(extension_id, percent_downloaded));
63 } 68 }
64 69
70 void InstallTracker::OnBeginCrxInstall(const std::string& extension_id) {
71 FOR_EACH_OBSERVER(
72 InstallObserver, observers_, OnBeginCrxInstall(extension_id));
73 }
74
65 void InstallTracker::OnInstallFailure( 75 void InstallTracker::OnInstallFailure(
66 const std::string& extension_id) { 76 const std::string& extension_id) {
67 FOR_EACH_OBSERVER(InstallObserver, observers_, 77 FOR_EACH_OBSERVER(InstallObserver, observers_,
68 OnInstallFailure(extension_id)); 78 OnInstallFailure(extension_id));
69 } 79 }
70 80
71 void InstallTracker::Shutdown() { 81 void InstallTracker::Shutdown() {
72 FOR_EACH_OBSERVER(InstallObserver, observers_, OnShutdown()); 82 FOR_EACH_OBSERVER(InstallObserver, observers_, OnShutdown());
73 } 83 }
74 84
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 default: 138 default:
129 NOTREACHED(); 139 NOTREACHED();
130 } 140 }
131 } 141 }
132 142
133 void InstallTracker::OnAppsReordered() { 143 void InstallTracker::OnAppsReordered() {
134 FOR_EACH_OBSERVER(InstallObserver, observers_, OnAppsReordered()); 144 FOR_EACH_OBSERVER(InstallObserver, observers_, OnAppsReordered());
135 } 145 }
136 146
137 } // namespace extensions 147 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/install_tracker.h ('k') | chrome/browser/extensions/tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698