OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ash/launcher/launcher_arc_app_updater.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_arc_app_updater.h" |
6 | 6 |
7 LauncherArcAppUpdater::LauncherArcAppUpdater( | 7 LauncherArcAppUpdater::LauncherArcAppUpdater( |
8 Delegate* delegate, | 8 Delegate* delegate, |
9 content::BrowserContext* browser_context) | 9 content::BrowserContext* browser_context) |
10 : LauncherAppUpdater(delegate, browser_context) { | 10 : LauncherAppUpdater(delegate, browser_context) { |
11 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(browser_context); | 11 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(browser_context); |
12 DCHECK(prefs); | 12 DCHECK(prefs); |
13 prefs->AddObserver(this); | 13 prefs->AddObserver(this); |
14 } | 14 } |
15 | 15 |
16 LauncherArcAppUpdater::~LauncherArcAppUpdater() { | 16 LauncherArcAppUpdater::~LauncherArcAppUpdater() { |
17 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(browser_context()); | 17 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(browser_context()); |
18 DCHECK(prefs); | 18 DCHECK(prefs); |
19 prefs->RemoveObserver(this); | 19 prefs->RemoveObserver(this); |
20 } | 20 } |
21 | 21 |
22 void LauncherArcAppUpdater::OnAppRegistered( | 22 void LauncherArcAppUpdater::OnAppRegistered( |
23 const std::string& app_id, | 23 const std::string& app_id, |
24 const ArcAppListPrefs::AppInfo& app_info) { | 24 const ArcAppListPrefs::AppInfo& app_info) { |
25 delegate()->OnAppInstalled(browser_context(), app_id); | 25 delegate()->OnAppInstalled(browser_context(), app_id); |
26 } | 26 } |
27 | 27 |
28 void LauncherArcAppUpdater::OnAppRemoved(const std::string& app_id) { | 28 void LauncherArcAppUpdater::OnAppRemoved(const std::string& app_id) { |
| 29 delegate()->OnAppUninstalledPrepared(browser_context(), app_id); |
29 delegate()->OnAppUninstalled(browser_context(), app_id); | 30 delegate()->OnAppUninstalled(browser_context(), app_id); |
30 } | 31 } |
OLD | NEW |