| 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 2a9185eaec597f404a482bcc59a448c167b7171a..a8bd3d7902ac8e82008098f226e031bdee782164 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
|
| @@ -39,7 +39,6 @@
|
| const char kLastBackupAndroidId[] = "last_backup_android_id";
|
| const char kLastBackupTime[] = "last_backup_time";
|
| const char kLastLaunchTime[] = "lastlaunchtime";
|
| -const char kLaunchable[] = "launchable";
|
| const char kShouldSync[] = "should_sync";
|
| const char kSystem[] = "system";
|
| const char kOrientationLock[] = "orientation_lock";
|
| @@ -458,7 +457,6 @@
|
| bool sticky = false;
|
| bool notifications_enabled = true;
|
| bool shortcut = false;
|
| - bool launchable = true;
|
| int orientation_lock_value = 0;
|
| app->GetString(kName, &name);
|
| app->GetString(kPackageName, &package_name);
|
| @@ -468,7 +466,6 @@
|
| app->GetBoolean(kSticky, &sticky);
|
| app->GetBoolean(kNotificationsEnabled, ¬ifications_enabled);
|
| app->GetBoolean(kShortcut, &shortcut);
|
| - app->GetBoolean(kLaunchable, &launchable);
|
| app->GetInteger(kOrientationLock, &orientation_lock_value);
|
|
|
| DCHECK(!name.empty());
|
| @@ -482,18 +479,17 @@
|
| }
|
|
|
| bool deferred;
|
| - if (SetNotificationsEnabledDeferred(prefs_).Get(app_id, &deferred))
|
| + if (SetNotificationsEnabledDeferred(prefs_).Get(app_id, &deferred)) {
|
| notifications_enabled = deferred;
|
| -
|
| + }
|
| arc::mojom::OrientationLock orientation_lock =
|
| static_cast<arc::mojom::OrientationLock>(orientation_lock_value);
|
|
|
| return base::MakeUnique<AppInfo>(
|
| name, package_name, activity, intent_uri, icon_resource_id,
|
| last_launch_time, GetInstallTime(app_id), sticky, notifications_enabled,
|
| - ready_apps_.count(app_id) > 0,
|
| - launchable && arc::ShouldShowInLauncher(app_id), shortcut, launchable,
|
| - orientation_lock);
|
| + ready_apps_.count(app_id) > 0, arc::ShouldShowInLauncher(app_id),
|
| + shortcut, orientation_lock);
|
| }
|
|
|
| bool ArcAppListPrefs::IsRegistered(const std::string& app_id) const {
|
| @@ -594,20 +590,6 @@
|
| }
|
| }
|
|
|
| -void ArcAppListPrefs::MayAddNonLaunchableApp(const std::string& name,
|
| - const std::string& package_name,
|
| - const std::string& activity) {
|
| - DCHECK(IsArcEnabled());
|
| - if (IsRegistered(GetAppId(package_name, activity)))
|
| - return;
|
| -
|
| - AddAppAndShortcut(name, package_name, activity,
|
| - std::string() /* intent_uri */,
|
| - std::string() /* icon_resource_id */, false /* sticky */,
|
| - false /* notifications_enabled */, false /* shortcut */,
|
| - false /* launchable */, arc::mojom::OrientationLock::NONE);
|
| -}
|
| -
|
| void ArcAppListPrefs::AddAppAndShortcut(
|
| const std::string& name,
|
| const std::string& package_name,
|
| @@ -617,16 +599,13 @@
|
| const bool sticky,
|
| const bool notifications_enabled,
|
| const bool shortcut,
|
| - const bool launchable,
|
| const arc::mojom::OrientationLock orientation_lock) {
|
| std::string app_id = shortcut ? GetAppId(package_name, intent_uri)
|
| : GetAppId(package_name, activity);
|
| - const bool was_registered = IsRegistered(app_id);
|
| + bool was_registered = IsRegistered(app_id);
|
|
|
| if (was_registered) {
|
| std::unique_ptr<ArcAppListPrefs::AppInfo> app_old_info = GetApp(app_id);
|
| - DCHECK(app_old_info);
|
| - DCHECK(launchable);
|
| if (name != app_old_info->name) {
|
| FOR_EACH_OBSERVER(Observer, observer_list_,
|
| OnAppNameUpdated(app_id, name));
|
| @@ -643,7 +622,6 @@
|
| app_dict->SetBoolean(kSticky, sticky);
|
| app_dict->SetBoolean(kNotificationsEnabled, notifications_enabled);
|
| app_dict->SetBoolean(kShortcut, shortcut);
|
| - app_dict->SetBoolean(kLaunchable, launchable);
|
| app_dict->SetInteger(kOrientationLock, static_cast<int>(orientation_lock));
|
|
|
| // Note the install time is the first time the Chrome OS sees the app, not the
|
| @@ -665,8 +643,7 @@
|
| AppInfo app_info(
|
| name, package_name, activity, intent_uri, icon_resource_id,
|
| base::Time(), GetInstallTime(app_id), sticky, notifications_enabled,
|
| - true, launchable && arc::ShouldShowInLauncher(app_id), shortcut,
|
| - launchable, orientation_lock);
|
| + true, arc::ShouldShowInLauncher(app_id), shortcut, orientation_lock);
|
| FOR_EACH_OBSERVER(Observer,
|
| observer_list_,
|
| OnAppRegistered(app_id, app_info));
|
| @@ -726,7 +703,7 @@
|
| std::string() /* intent_uri */,
|
| std::string() /* icon_resource_id */, app->sticky,
|
| app->notifications_enabled, false /* shortcut */,
|
| - true /* launchable */, app->orientation_lock);
|
| + app->orientation_lock);
|
| }
|
|
|
| // Detect removed ARC apps after current refresh.
|
| @@ -766,7 +743,7 @@
|
| std::string() /* intent_uri */,
|
| std::string() /* icon_resource_id */, app->sticky,
|
| app->notifications_enabled, false /* shortcut */,
|
| - true /* launchable */, app->orientation_lock);
|
| + app->orientation_lock);
|
| }
|
|
|
| void ArcAppListPrefs::OnInstallShortcut(arc::mojom::ShortcutInfoPtr shortcut) {
|
| @@ -779,7 +756,7 @@
|
| std::string() /* activity */, shortcut->intent_uri,
|
| shortcut->icon_resource_id, false /* sticky */,
|
| false /* notifications_enabled */, true /* shortcut */,
|
| - true /* launchable */, arc::mojom::OrientationLock::NONE);
|
| + arc::mojom::OrientationLock::NONE);
|
| }
|
|
|
| void ArcAppListPrefs::OnPackageRemoved(const mojo::String& package_name) {
|
| @@ -847,9 +824,7 @@
|
|
|
| void ArcAppListPrefs::OnTaskCreated(int32_t task_id,
|
| const mojo::String& package_name,
|
| - const mojo::String& activity,
|
| - const mojo::String& name) {
|
| - MayAddNonLaunchableApp(name, package_name, activity);
|
| + const mojo::String& activity) {
|
| FOR_EACH_OBSERVER(Observer, observer_list_,
|
| OnTaskCreated(task_id, package_name, activity));
|
| }
|
| @@ -985,7 +960,6 @@
|
| bool ready,
|
| bool showInLauncher,
|
| bool shortcut,
|
| - bool launchable,
|
| arc::mojom::OrientationLock orientation_lock)
|
| : name(name),
|
| package_name(package_name),
|
| @@ -999,7 +973,6 @@
|
| ready(ready),
|
| showInLauncher(showInLauncher),
|
| shortcut(shortcut),
|
| - launchable(launchable),
|
| orientation_lock(orientation_lock) {}
|
|
|
| // Need to add explicit destructor for chromium style checker error:
|
|
|