OLD | NEW |
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/ui/app_list/search/app_result.h" | 5 #include "chrome/browser/ui/app_list/search/app_result.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_system_factory.h" | 8 #include "chrome/browser/extensions/extension_system_factory.h" |
9 #include "chrome/browser/extensions/install_tracker.h" | 9 #include "chrome/browser/extensions/install_tracker.h" |
10 #include "chrome/browser/extensions/install_tracker_factory.h" | 10 #include "chrome/browser/extensions/install_tracker_factory.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 | 110 |
111 return context_menu_->GetMenuModel(); | 111 return context_menu_->GetMenuModel(); |
112 } | 112 } |
113 | 113 |
114 void AppResult::StartObservingInstall() { | 114 void AppResult::StartObservingInstall() { |
115 DCHECK(!install_tracker_); | 115 DCHECK(!install_tracker_); |
116 | 116 |
117 install_tracker_ = extensions::InstallTrackerFactory::GetForProfile(profile_); | 117 install_tracker_ = extensions::InstallTrackerFactory::GetForProfile(profile_); |
118 install_tracker_->AddObserver(this); | 118 install_tracker_->AddObserver(this); |
| 119 DLOG(INFO) << "Observing: " << app_id_; |
119 } | 120 } |
120 | 121 |
121 void AppResult::StopObservingInstall() { | 122 void AppResult::StopObservingInstall() { |
122 if (install_tracker_) | 123 if (install_tracker_) |
123 install_tracker_->RemoveObserver(this); | 124 install_tracker_->RemoveObserver(this); |
124 | 125 |
125 install_tracker_ = NULL; | 126 install_tracker_ = NULL; |
126 } | 127 } |
127 | 128 |
128 bool AppResult::RunExtensionEnableFlow() { | 129 bool AppResult::RunExtensionEnableFlow() { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 192 |
192 void AppResult::OnExtensionInstalled(const extensions::Extension* extension) {} | 193 void AppResult::OnExtensionInstalled(const extensions::Extension* extension) {} |
193 | 194 |
194 void AppResult::OnExtensionLoaded(const extensions::Extension* extension) { | 195 void AppResult::OnExtensionLoaded(const extensions::Extension* extension) { |
195 UpdateIcon(); | 196 UpdateIcon(); |
196 } | 197 } |
197 | 198 |
198 void AppResult::OnExtensionUnloaded(const extensions::Extension* extension) {} | 199 void AppResult::OnExtensionUnloaded(const extensions::Extension* extension) {} |
199 | 200 |
200 void AppResult::OnExtensionUninstalled(const extensions::Extension* extension) { | 201 void AppResult::OnExtensionUninstalled(const extensions::Extension* extension) { |
| 202 DLOG(INFO) << "uninstalleD: " << extension->id(); |
201 if (extension->id() != app_id_) | 203 if (extension->id() != app_id_) |
202 return; | 204 return; |
203 | 205 |
204 NotifyItemUninstalled(); | 206 NotifyItemUninstalled(); |
205 } | 207 } |
206 | 208 |
207 void AppResult::OnAppsReordered() {} | 209 void AppResult::OnAppsReordered() {} |
208 | 210 |
209 void AppResult::OnAppInstalledToAppList(const std::string& extension_id) {} | 211 void AppResult::OnAppInstalledToAppList(const std::string& extension_id) {} |
210 | 212 |
211 void AppResult::OnShutdown() { StopObservingInstall(); } | 213 void AppResult::OnShutdown() { StopObservingInstall(); } |
212 | 214 |
213 } // namespace app_list | 215 } // namespace app_list |
OLD | NEW |