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

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_extension_app_updater.cc

Issue 2819413003: Refactor extension app icon. (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
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_extension_app_updater.h" 5 #include "chrome/browser/ui/ash/launcher/launcher_extension_app_updater.h"
6 6
7 #include "chrome/browser/chromeos/extensions/gfx_utils.h" 7 #include "chrome/browser/chromeos/extensions/gfx_utils.h"
8 #include "chrome/browser/chromeos/profiles/profile_helper.h" 8 #include "chrome/browser/chromeos/profiles/profile_helper.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 10 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 DCHECK_EQ(extension_registry_, registry); 57 DCHECK_EQ(extension_registry_, registry);
58 StopObservingExtensionRegistry(); 58 StopObservingExtensionRegistry();
59 } 59 }
60 60
61 void LauncherExtensionAppUpdater::OnPackageInstalled( 61 void LauncherExtensionAppUpdater::OnPackageInstalled(
62 const arc::mojom::ArcPackageInfo& package_info) { 62 const arc::mojom::ArcPackageInfo& package_info) {
63 UpdateEquivalentHostedApp(package_info.package_name); 63 UpdateEquivalentHostedApp(package_info.package_name);
64 } 64 }
65 65
66 void LauncherExtensionAppUpdater::OnPackageRemoved( 66 void LauncherExtensionAppUpdater::OnPackageRemoved(
67 const std::string& package_name) { 67 const std::string& package_name,
68 bool uninstalled) {
68 UpdateEquivalentHostedApp(package_name); 69 UpdateEquivalentHostedApp(package_name);
69 } 70 }
70 71
71 void LauncherExtensionAppUpdater::StartObservingExtensionRegistry() { 72 void LauncherExtensionAppUpdater::StartObservingExtensionRegistry() {
72 DCHECK(!extension_registry_); 73 DCHECK(!extension_registry_);
73 extension_registry_ = extensions::ExtensionRegistry::Get(browser_context()); 74 extension_registry_ = extensions::ExtensionRegistry::Get(browser_context());
74 extension_registry_->AddObserver(this); 75 extension_registry_->AddObserver(this);
75 } 76 }
76 77
77 void LauncherExtensionAppUpdater::StopObservingExtensionRegistry() { 78 void LauncherExtensionAppUpdater::StopObservingExtensionRegistry() {
(...skipping 27 matching lines...) Expand all
105 } 106 }
106 107
107 void LauncherExtensionAppUpdater::UpdateEquivalentHostedApp( 108 void LauncherExtensionAppUpdater::UpdateEquivalentHostedApp(
108 const std::string& arc_package_name) { 109 const std::string& arc_package_name) {
109 const std::vector<std::string> extension_ids = 110 const std::vector<std::string> extension_ids =
110 extensions::util::GetEquivalentInstalledExtensions(browser_context(), 111 extensions::util::GetEquivalentInstalledExtensions(browser_context(),
111 arc_package_name); 112 arc_package_name);
112 for (const auto& iter : extension_ids) 113 for (const auto& iter : extension_ids)
113 UpdateHostedApp(iter); 114 UpdateHostedApp(iter);
114 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698