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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc

Issue 2347293002: arc: Add InstanceHelper::GetInstanceForMethod() (Closed)
Patch Set: git cl format/lint Created 4 years, 3 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/app_list/arc/arc_app_list_prefs.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
index 3674b2e100da09ab27eea2d505c9a289210ce246..3a889ce84014a65b9597d59afc133d0bdc5369cf 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
@@ -354,17 +354,10 @@ void ArcAppListPrefs::SetNotificationsEnabled(const std::string& app_id,
return;
}
- arc::mojom::AppInstance* app_instance = app_instance_holder_->instance();
- if (!app_instance) {
- // AppInstance should be ready since we have app_id in ready_apps_.
- NOTREACHED();
- return;
- }
-
- if (app_instance_holder_->version() < kSetNotificationsEnabledMinVersion) {
- VLOG(2) << "app version is too small to set notifications enabled.";
+ auto* app_instance = app_instance_holder_->GetInstanceForVersion(
Yusuke Sato 2016/09/16 23:58:48 is * necessary here? (ok, confirmed this with Lui
Luis Héctor Chávez 2016/09/17 00:30:53 Acknowledged.
+ kSetNotificationsEnabledMinVersion, "SetNotificationsEnabled");
+ if (!app_instance)
return;
- }
SetNotificationsEnabledDeferred(prefs_).Remove(app_id);
app_instance->SetNotificationsEnabled(app_info->package_name, enabled);
@@ -1145,7 +1138,6 @@ std::vector<std::string> ArcAppListPrefs::GetPackagesFromPrefs(
prefs_->GetDictionary(prefs::kArcPackages);
for (base::DictionaryValue::Iterator package(*package_prefs);
!package.IsAtEnd(); package.Advance()) {
-
bool uninstalled = false;
package_prefs->GetBoolean(kSystem, &uninstalled);
if (installed != !uninstalled)

Powered by Google App Engine
This is Rietveld 408576698