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

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

Issue 2599673005: arc: Use GET_INTERFACE_FOR_METHOD macro (Closed)
Patch Set: Addressed feedback Created 3 years, 11 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 765fea0b6a8e5c6980419ab0de52a07cfe85adb7..3be2a3106979f65f56add826b28876c5c9d33da6 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
@@ -50,9 +50,6 @@ const char kShouldSync[] = "should_sync";
const char kSystem[] = "system";
const char kUninstalled[] = "uninstalled";
-constexpr uint32_t kSetNotificationsEnabledMinVersion = 6;
-constexpr uint32_t kRequestIconMinVersion = 9;
-
// Provider of write access to a dictionary storing ARC prefs.
class ScopedArcPrefUpdate : public DictionaryPrefUpdate {
public:
@@ -325,7 +322,7 @@ void ArcAppListPrefs::RequestIcon(const std::string& app_id,
if (app_info->icon_resource_id.empty()) {
auto* app_instance =
- app_instance_holder_->GetInstanceForMethod("RequestAppIcon");
+ ARC_GET_INSTANCE_FOR_METHOD(app_instance_holder_, RequestAppIcon);
// Version 0 instance should always be available here because has_instance()
// returned true above.
DCHECK(app_instance);
@@ -333,8 +330,8 @@ void ArcAppListPrefs::RequestIcon(const std::string& app_id,
app_info->package_name, app_info->activity,
static_cast<arc::mojom::ScaleFactor>(scale_factor));
} else {
- auto* app_instance = app_instance_holder_->GetInstanceForMethod(
- "RequestIcon", kRequestIconMinVersion);
+ auto* app_instance =
+ ARC_GET_INSTANCE_FOR_METHOD(app_instance_holder_, RequestIcon);
if (!app_instance)
return; // The instance version on ARC side was too old.
app_instance->RequestIcon(
@@ -367,8 +364,8 @@ void ArcAppListPrefs::SetNotificationsEnabled(const std::string& app_id,
return;
}
- auto* app_instance = app_instance_holder_->GetInstanceForMethod(
- "SetNotificationsEnabled", kSetNotificationsEnabledMinVersion);
+ auto* app_instance = ARC_GET_INSTANCE_FOR_METHOD(app_instance_holder_,
+ SetNotificationsEnabled);
if (!app_instance)
return;
@@ -663,7 +660,7 @@ void ArcAppListPrefs::SetDefaltAppsReadyCallback(base::Closure callback) {
void ArcAppListPrefs::OnInstanceReady() {
// Init() is also available at version 0.
arc::mojom::AppInstance* app_instance =
- app_instance_holder_->GetInstanceForMethod("RefreshAppList");
+ ARC_GET_INSTANCE_FOR_METHOD(app_instance_holder_, RefreshAppList);
// Note, sync_service_ may be nullptr in testing.
sync_service_ = arc::ArcPackageSyncableService::Get(profile_);
« 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