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

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

Issue 2347293002: arc: Add InstanceHelper::GetInstanceForMethod() (Closed)
Patch Set: No more DCHECK 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..643669d1c720a6d51cdf1165b065ff597259eae3 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_->GetInstanceForMethod(
+ "SetNotificationsEnabled", kSetNotificationsEnabledMinVersion);
+ 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)
« no previous file with comments | « chrome/browser/task_manager/providers/arc/arc_process_task.cc ('k') | chrome/browser/ui/app_list/arc/arc_app_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698